Lab: File path traversal, validation of file extension with null byte bypass
Summary: PortSwigger's Web Security Academy lab describes a path traversal vulnerability in a product image display feature, where the application validates that a supplied filename ends with the expected file extension. The solution modifies the filename parameter to ../../../etc/passwd%00.png, and the null byte bypasses the extension check so the response returns the contents of the /etc/passwd file.
Bottom line: An extension check that a single null byte defeats leaves the server's /etc/passwd readable, and the same traversal pattern reaches configuration files and credentials stored anywhere the web process can read.
Read the original at PortSwigger Research ↗
- Topics
- Vulnerabilities & Patching
- Related
- Attackers Exploit UnrealIRCd Flaw That Enables Server-Level Command Injection Cyber Risks · Nov 14, 2026U.S. CISA adds Check Point and UnrealIRCd flaws to its Known Exploited Vulnerabilities catalog Cyber Risks · Nov 14, 2026PostgreSQL Patches 52 Flaws, Including 22-Year-Old Bug Enabling Authenticated RCE Cyber Risks · Nov 13, 2026