Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix subpackage import vulnerability #238

Merged
merged 5 commits into from
Jan 17, 2025
Merged

Conversation

aymeric-roucher
Copy link
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
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
4 checks passed
@stackviolator
Copy link
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

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