CoolFace
Modelpublic

ftameesh/trustremotecodepoc

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes7downloads
Model Card

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

python
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=True with untrusted models
  • Audit model repositories before loading
  • Run model loading in sandboxed environments