You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
save_io set to True is useful for reading the generated prompt, in a real-case scenario is not needed.
The vulnerability lies in template field, all other fields are set for the Proof of Concept. An attacker doesn't need to control those.
The vulnerability has been fixed here, but v0.7.2 is still vulnerable.
Impact
Attackers can run arbitrary system command without any restriction (e.g. they could use a reverse shell and gain access to the server) .
The impact is critical as the attacker can completely takeover the server host.
Credits
Edoardo Ottavianelli
The text was updated successfully, but these errors were encountered:
Summary
A Server Side Template Injection in SpaCy-LLM caused by usage of unsafe functions of Jinja2 allows Remote Command Execution on the server host.
Details
Installation Steps
python -m venv .env source .env/bin/activate pip install -U pip setuptools wheel pip install -U spacy python -m pip install spacy-llm python -m spacy download en_core_web_sm
The vulnerability is caused by the usage of vulnerable functions of Jinja2 template engine (https://github.com/explosion/spacy-llm/blob/main/spacy_llm/tasks/builtin_task.py).
PoC
Another payload could be
{{self.__init__.__globals__.__builtins__.__import__('os').popen('touch pwned')}}
, which immediately creates a file called 'pwned' as soon the api is called.Read more about Jinja2 SSTI here https://book.hacktricks.xyz/pentesting-web/ssti-server-side-template-injection/jinja2-ssti.
Note that:
save_io
set toTrue
is useful for reading the generated prompt, in a real-case scenario is not needed.template
field, all other fields are set for the Proof of Concept. An attacker doesn't need to control those.Impact
Attackers can run arbitrary system command without any restriction (e.g. they could use a reverse shell and gain access to the server) .
The impact is critical as the attacker can completely takeover the server host.
Credits
Edoardo Ottavianelli
The text was updated successfully, but these errors were encountered: