-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
Template injection to arbitrary code execution #4394
Comments
The index of "subclasses " can be obtained in the following way.
|
This comment was marked as outdated.
This comment was marked as outdated.
Sorry for the bot reply, it's still a beta and shouldn't be attempting to close security-related issues like this. I'm triaging this right now and should have an update shortly. |
Issue confirmed, escalating to Apologies for the delay here. This issue slipped through the cracks, which should not have happened. We're going to use this instance as an internal case study to make sure we do way better in the future. We've already added a We're also looking at automation to help us detect security-related issues opened on public GitHub, so we can more effectively internally escalate it to |
jinja2 templates are not sandboxed and are at risk for arbitrary code execution. To mitigate this risk: - We no longer support loading jinja2-formatted prompt template files. - `PromptTemplate` with jinja2 may still be constructed manually, but the class carries a security warning reminding the user to not pass untrusted input into it. Resolves #4394.
jinja2 templates are not sandboxed and are at risk for arbitrary code execution. To mitigate this risk: - We no longer support loading jinja2-formatted prompt template files. - `PromptTemplate` with jinja2 may still be constructed manually, but the class carries a security warning reminding the user to not pass untrusted input into it. Resolves #4394.
jinja2 templates are not sandboxed and are at risk for arbitrary code execution. To mitigate this risk: - We no longer support loading jinja2-formatted prompt template files. - `PromptTemplate` with jinja2 may still be constructed manually, but the class carries a security warning reminding the user to not pass untrusted input into it. Resolves langchain-ai#4394.
System Info
windows 11
Who can help?
No response
Information
Related Components
Reproduction
dir
command will be executeattack scene: Alice can send prompt file to Bob and let Bob to load it.
analysis: Jinja2 is used to concat prompts. Template injection will happened
note: in the pt.json, the
template
has payload, the index of__subclasses__
maybe different in other environment.Expected behavior
code should not be execute
The text was updated successfully, but these errors were encountered: