CVE-2020-28468: pwntools Server-Side Template Injection (SSTI) vulnerability
Summary
CVE-2020-28468: pwntools Server-Side Template Injection (SSTI) vulnerability. Affects pwntools versions < 4.3.1. Fixed in 4.3.1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
pwntools is a Python library designed for exploit development and binary analysis. It provides a wide range of tools and utilities to assist in the process of creating exploits for security testing and research. However, versions prior to 4.3.1 of pwntools are vulnerable to Server-Side Template Injection (SSTI), which can potentially lead to remote code execution.
Vulnerability Detail
The shellcraft generator in affected versions of pwntools contains a Server-Side Template Injection (SSTI) vulnerability. This vulnerability allows an attacker to inject malicious code into templates, which are then executed on the server-side. Exploiting this vulnerability can lead to remote code execution, enabling an attacker to execute arbitrary commands on the target system. The impact of this vulnerability is critical, as it can result in a complete compromise of the affected system.
How To Fix
Latest published version: 4.15.0 as of 22 Oct 2026
pip install --upgrade "pwntools==4.15.0"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
4.3.1
This is the first release that contains the fix.
pip install --upgrade "pwntools==4.3.1"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can avoid using the vulnerable functions 'pwnlib.shellcraft.pretty' and 'pwnlib.constants.ConstantsModule.eval'. By refraining from using these functions, you can reduce the risk of exploitation. However, it is strongly advised to upgrade to the latest version of pwntools as soon as possible.
Conclusion
The pwntools package prior to version 4.3.1 is vulnerable to Server-Side Template Injection (SSTI), which can lead to remote code execution. It is crucial to upgrade to the latest version of pwntools to mitigate this vulnerability. For further assistance and support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for pwntools →
FAQ
pwntools is a Python library used for exploit development and binary analysis. It provides a wide range of tools and utilities to assist in the process of creating exploits for security testing and research.
Server-Side Template Injection (SSTI) is a vulnerability that allows an attacker to inject malicious code into templates, which are then executed on the server-side. This can lead to remote code execution and potentially compromise the entire system.
The impact of this vulnerability is critical. Exploiting the Server-Side Template Injection (SSTI) vulnerability in pwntools can result in remote code execution, allowing an attacker to execute arbitrary commands on the target system and potentially gain full control.
To fix this vulnerability, it is recommended to upgrade pwntools to version 4.3.1 or later. This version includes the necessary patches to mitigate the Server-Side Template Injection vulnerability. You can update pwntools by running the command 'pip install --upgrade pwntools'.
As a temporary workaround, you can avoid using the vulnerable functions 'pwnlib.shellcraft.pretty' and 'pwnlib.constants.ConstantsModule.eval'. By refraining from using these functions, you can reduce the risk of exploitation. However, upgrading to the latest version of pwntools is strongly recommended.