/

CVE-2026-67185

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in TinyWeb HttpBuilder

CVE-2026-67185

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

TinyWeb suffers from a path traversal flaw where URL paths containing ../ sequences are concatenated directly with the web root without any normalization or boundary checks.

An unauthenticated attacker can issue crafted requests to read arbitrary files on the server, which becomes especially dangerous when sensitive system or application data is accessible to the TinyWeb process.

TinyWeb suffers from a path traversal flaw where URL paths containing ../ sequences are concatenated directly with the web root without any normalization or boundary checks.

An unauthenticated attacker can issue crafted requests to read arbitrary files on the server, which becomes especially dangerous when sensitive system or application data is accessible to the TinyWeb process.

Affected context

This vulnerability occurs in TinyWeb deployments that:

  • Use TinyWeb versions up to and including 0.0.8
  • Serve files directly from the filesystem using HttpBuilder::buildResponse() and HttpFile::setFile()
  • Do not apply additional reverse proxy, WAF, or URL normalization in front of TinyWeb

Risk increases significantly when the server process runs with broad filesystem privileges (for example, as root) or on hosts where sensitive configuration, credential stores, or private keys are stored within reachable paths.

This vulnerability occurs in TinyWeb deployments that:

  • Use TinyWeb versions up to and including 0.0.8
  • Serve files directly from the filesystem using HttpBuilder::buildResponse() and HttpFile::setFile()
  • Do not apply additional reverse proxy, WAF, or URL normalization in front of TinyWeb

Risk increases significantly when the server process runs with broad filesystem privileges (for example, as root) or on hosts where sensitive configuration, credential stores, or private keys are stored within reachable paths.

Exploit preconditions

  • Attack surface: HTTP interface exposed by TinyWeb
  • Required access: No authentication; any network client that can reach the server can attempt exploitation
  • Trigger point: Handling of URL paths in HttpBuilder::buildResponse(), where user-supplied paths containing ../ are processed and passed to HttpFile::setFile()
  • Why exploitation is possible: The server concatenates the raw, unnormalized request path to the configured web root without removing dot segments or enforcing directory boundaries, allowing traversal outside the intended document root.
  • Attack surface: HTTP interface exposed by TinyWeb
  • Required access: No authentication; any network client that can reach the server can attempt exploitation
  • Trigger point: Handling of URL paths in HttpBuilder::buildResponse(), where user-supplied paths containing ../ are processed and passed to HttpFile::setFile()
  • Why exploitation is possible: The server concatenates the raw, unnormalized request path to the configured web root without removing dot segments or enforcing directory boundaries, allowing traversal outside the intended document root.

Why this happens

The core issue is improper validation and sanitization of file paths derived from user input.

In TinyWeb, the URL path from the HTTP request is treated as a filesystem path and joined with the web root without normalization, canonicalization, or checks that the resulting path remains within the intended directory.

This design maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"), where untrusted path components such as ../ allow access to files outside the allowed directory scope.

The core issue is improper validation and sanitization of file paths derived from user input.

In TinyWeb, the URL path from the HTTP request is treated as a filesystem path and joined with the web root without normalization, canonicalization, or checks that the resulting path remains within the intended directory.

This design maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ("Path Traversal"), where untrusted path components such as ../ allow access to files outside the allowed directory scope.

Potential impact

  • An attacker may read sensitive configuration files and system data.
  • An attacker could access application secrets, credential stores, and private keys.
  • An attacker can potentially gather information useful for further attacks, such as local service configuration and user data.
  • In some environments, attackers could read log files or source code, aiding reconnaissance and exploitation of other weaknesses.
  • An attacker may read sensitive configuration files and system data.
  • An attacker could access application secrets, credential stores, and private keys.
  • An attacker can potentially gather information useful for further attacks, such as local service configuration and user data.
  • In some environments, attackers could read log files or source code, aiding reconnaissance and exploitation of other weaknesses.

General mitigation guidance

Mitigation efforts typically focus on enforcing strict directory boundaries and treating all path components derived from user input as untrusted.

Common defensive patterns include:

  • Normalizing and canonicalizing requested paths before use, including removing dot segments (. and ..) and redundant separators.
  • Enforcing that the resolved filesystem path remains within a designated document root by checking against a canonical base directory.
  • Using a whitelist-based approach where only known, mapped resources or IDs are translated to filesystem paths, rather than exposing raw directory structures.
  • Running the server process with least privilege, limiting which filesystem locations are actually readable even if traversal is attempted.
  • Separating sensitive files, such as credential stores and private keys, from directories that are ever joined with user-controlled paths.

Mitigation efforts typically focus on enforcing strict directory boundaries and treating all path components derived from user input as untrusted.

Common defensive patterns include:

  • Normalizing and canonicalizing requested paths before use, including removing dot segments (. and ..) and redundant separators.
  • Enforcing that the resolved filesystem path remains within a designated document root by checking against a canonical base directory.
  • Using a whitelist-based approach where only known, mapped resources or IDs are translated to filesystem paths, rather than exposing raw directory structures.
  • Running the server process with least privilege, limiting which filesystem locations are actually readable even if traversal is attempted.
  • Separating sensitive files, such as credential stores and private keys, from directories that are ever joined with user-controlled paths.

How teams detect issues like this

Organizations can detect path traversal vulnerabilities and their exploitation using several complementary approaches:

  • Static analysis rules that flag direct concatenation of user-controlled paths with filesystem directories, and that look for the absence of normalization, canonicalization, or boundary checks.
  • Code review practices that focus on file-serving components, checking that all path handling functions validate and constrain paths rigorously.
  • Runtime monitoring and logging that capture suspicious URL patterns, including repeated ../ sequences or attempts to access known sensitive filenames, with alerts on anomalous access.
  • Security testing such as dynamic application security testing (DAST) and manual penetration testing that probe for traversal by requesting files outside the document root.
  • Integration of automated review tools in CI pipelines to enforce policies around safe path handling and filesystem access APIs.

Organizations can detect path traversal vulnerabilities and their exploitation using several complementary approaches:

  • Static analysis rules that flag direct concatenation of user-controlled paths with filesystem directories, and that look for the absence of normalization, canonicalization, or boundary checks.
  • Code review practices that focus on file-serving components, checking that all path handling functions validate and constrain paths rigorously.
  • Runtime monitoring and logging that capture suspicious URL patterns, including repeated ../ sequences or attempts to access known sensitive filenames, with alerts on anomalous access.
  • Security testing such as dynamic application security testing (DAST) and manual penetration testing that probe for traversal by requesting files outside the document root.
  • Integration of automated review tools in CI pipelines to enforce policies around safe path handling and filesystem access APIs.

Sources

SourceLink
github.comgithub.com/theopaid/Unauthenticated-Path-Traversal-Allows-Arbitrary-File-Read-TinyWeb-
vulncheck.comvulncheck.com/advisories/tinyweb-path-traversal-via-url-path-component

Frequently asked

questions

Yes. Any client that can reach the TinyWeb HTTP service can attempt to exploit the path traversal by crafting URLs with ../ sequences, without needing local access to the host.

Only network access to the TinyWeb server is required. No authentication or prior compromise is needed, although the data they can read is limited by the filesystem permissions of the TinyWeb process.

Implement strict path normalization and canonicalization, then verify that the resulting path is confined to a predefined document root or a set of whitelisted resources. Avoid exposing raw filesystem structure directly to user input, and treat all path segments as untrusted.

Design file-serving components with clear trust boundaries: never use user-supplied paths directly, enforce directory constraints, and perform security-focused code reviews on any logic that touches the filesystem. Combine these patterns with least-privilege execution and automated checks to catch unsafe path handling early in development.

Yes. Any client that can reach the TinyWeb HTTP service can attempt to exploit the path traversal by crafting URLs with ../ sequences, without needing local access to the host.

Only network access to the TinyWeb server is required. No authentication or prior compromise is needed, although the data they can read is limited by the filesystem permissions of the TinyWeb process.

Implement strict path normalization and canonicalization, then verify that the resulting path is confined to a predefined document root or a set of whitelisted resources. Avoid exposing raw filesystem structure directly to user input, and treat all path segments as untrusted.

Design file-serving components with clear trust boundaries: never use user-supplied paths directly, enforce directory constraints, and perform security-focused code reviews on any logic that touches the filesystem. Combine these patterns with least-privilege execution and automated checks to catch unsafe path handling early in development.

Find out what's already
exploitable in your codebase.