Skip to content

Fix subpackage import vulnerability#238

Merged
aymeric-roucher merged 5 commits intomainfrom
fix-import-vulnerability
Jan 17, 2025
Merged

Fix subpackage import vulnerability#238
aymeric-roucher merged 5 commits intomainfrom
fix-import-vulnerability

Conversation

@aymeric-roucher
Copy link
Copy Markdown
Collaborator

@aymeric-roucher aymeric-roucher commented Jan 17, 2025

A malicious LLM could execute malicious code by using subpackages from authorized packages, like this exploiting the fact that random is authorized:

import random
random._os.system("malicious bash command")

It required a supply chain attack to have user run a malicious LLM, but it could work.
So this PR fixes it!

Copy link
Copy Markdown
Member

@albertvillanova albertvillanova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the security fix.

@aymeric-roucher aymeric-roucher merged commit c255c1f into main Jan 17, 2025
@stackviolator
Copy link
Copy Markdown
Contributor

sorry for long wait.. post finally got cleared! wrote up a blog about the technical details on the jailbreak + malicious import. thank you guys for the cooperation and super quick fix :)

https://x.com/joshtmerrill/status/1890483661151056261

@albertvillanova albertvillanova deleted the fix-import-vulnerability branch March 31, 2025 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants