Summary
A path traversal vulnerability in the NavigaTUM propose_edits endpoint allows unauthenticated users to write files outside the intended temporary directory by abusing unsanitized file keys in JSON payloads.
Under typical deployment, this can enable attackers to overwrite application-writable public assets (such as images under /cdn) or consume disk space by creating arbitrary files, impacting availability and integrity of served content.
Affected context
This vulnerability occurs in the backend handling of the propose_edits API endpoint in NavigaTUM when:
- The application accepts JSON payloads containing user-controlled file keys or paths
- These keys are used to construct filesystem paths without robust normalization or restriction to a safe base directory
- The application user has write permissions to public or semi-public directories (e.g., /cdn) in the same filesystem tree
In such environments, traversal sequences like "../" in the supplied keys allow escaping the intended temporary directory and writing to other writable locations.
Exploit preconditions
- Attack surface: HTTP(S) API endpoint
propose_edits, accessible over the network. - Required access: No authentication required; any remote party who can reach the endpoint can attempt exploitation.
- Input control: Ability to send a crafted JSON payload with file keys containing traversal sequences (e.g.,
../../some/target.png). - Environmental conditions:
- Application constructs file paths by concatenating a base directory with user-supplied keys.
- The application user (process owner) has write permission to target directories (such as
/cdnor similar). - Why exploitation is possible: The server does not adequately sanitize, normalize, or validate file paths before performing write operations, allowing path traversal outside the intended temporary directory.
Why this happens
The core issue is improper neutralization of user input used in filesystem paths, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), with related behaviors from CWE-23 and CWE-26.
The propose_edits handler appears to take file identifiers from a JSON body and use them directly, or with insufficient checks, when constructing target paths for temporary storage.
When path components like ../ are not removed or rejected, and the resulting path is not validated to remain under a specific allowed directory, attackers can navigate to arbitrary locations writable by the application user.
This is an access control failure at the filesystem abstraction layer: logical assumptions about "temporary" scope are not enforced by robust path canonicalization and directory whitelisting.
Potential impact
- Overwriting public-facing images or static assets served from writable directories (e.g.,
/cdn), potentially defacing content. - Replacing UI elements, icons, or maps to mislead users or conduct phishing and content spoofing via trusted domains.
- Filling the server's storage with arbitrary files, leading to denial of service due to exhausted disk space.
- Disrupting application behavior if configuration-like assets or data files located in writable paths are overwritten.
- Degrading trust in the service if users encounter tampered or maliciously modified media.
General mitigation guidance
Effective mitigation focuses on strictly constraining where the application can read and write, and on robustly validating path input:
- Enforce directory whitelisting: Resolve and canonicalize any user-influenced path and verify that the final absolute path remains within a predefined, application-controlled directory (e.g., a dedicated temp/upload folder).
- Reject traversal patterns: Explicitly disallow path segments such as
../,..\, absolute paths, drive prefixes, and symbolic link escapes; use normalization functions and deny requests that change the parent directory. - Use generated filenames: Avoid using client-supplied names as filesystem paths; instead, generate server-side identifiers and store any user-visible name as metadata.
- Isolate writable directories: Configure the application to write only to isolated directories that are not used directly for serving critical static assets, or serve user-writable content from a separate domain or path with strict content-type controls.
- Least-privilege filesystem permissions: Run the application under an account with minimal filesystem rights, with no write permission to core code, configuration, or global static assets.
- Apply size and quota limits: Enforce file size caps and per-user or per-IP quotas to reduce the risk of disk exhaustion, even if a path validation fails elsewhere.
How teams detect issues like this
Organizations can identify and monitor for this class of vulnerability using a combination of code-centric and operational approaches:
- Static analysis and linters: Configure SAST tools to flag use of file APIs where user input contributes to path construction without normalization, canonicalization, or explicit checks against an allowed base directory.
- Code review patterns: During reviews, scrutinize endpoints that accept filenames or keys; ensure that:
- Paths are resolved via secure helpers.
- Absolute and parent directory references are rejected.
- Only server-generated identifiers are used for actual filesystem operations.
- Security-focused tests: Add unit and integration tests that attempt to upload or write using
../sequences and confirm that the application blocks or safely handles such attempts. - Runtime monitoring: Log file write operations that target directories outside approved upload/temp paths and alert on unexpected patterns or high-volume writes to static asset directories.
- Configuration and policy checks: Regularly audit deployment configurations to confirm that application users lack write access to directories containing code, templates, and critical static content.

