CVE-2020-28468: pwntools Server-Side Template Injection (SSTI) vulnerability

pwntools Updated 02 Oct 2025

Summary

20/04/2021
Yes i
Critical
9.8

CVE-2020-28468: pwntools Server-Side Template Injection (SSTI) vulnerability. Affects pwntools versions < 4.3.1. Fixed in 4.3.1. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback