ftameesh/trustremotecodepoc
07
Trust Remote Code PoC
⚠️ Security Research Only ⚠️
This model demonstrates the trust_remote_code vulnerability in HuggingFace Transformers.
What This Does
When loaded with trust_remote_code=True, this model writes a marker file to /tmp/trustremotecode.
This is a benign payload for demonstration purposes. A real attacker could:
- Exfiltrate credentials
- Establish reverse shells
- Install backdoors
Usage
from transformers import AutoConfig
# This will execute code and write to /tmp/trustremotecode
config = AutoConfig.from_pretrained("YOUR_USERNAME/trustremotecodepoc", trust_remote_code=True)
# Verify the PoC worked
import os
if os.path.exists("/tmp/trustremotecode"):
print("PoC successful - arbitrary code executed!")Mitigation
- Never use
trust_remote_code=Truewith untrusted models - Audit model repositories before loading
- Run model loading in sandboxed environments
