# Path traversal in privileged file write

User-controlled filename or URL segment joined to a privileged directory without normalization, letting it escape

_Area: Memory corruption and native code. Seen in 2 disclosed reports; 2 confirmed bounties: $6,000 and $13,337; latest 2025-07-29. Updated 2026-12-05._

## How it works
A privileged component (SYSTEM service, updater, debug handler) builds a destination path by joining a trusted base directory with a name taken from untrusted input — a URL's last segment, a remote filename, a control path. The code assumes the joined name is a simple leaf. That assumption breaks because the join primitive does not neutralize absolute paths or `..` sequences: `Path.Combine` discards the parent when the second argument is itself rooted, and raw string concatenation lets `..\..` climb out. The write then lands wherever the attacker chose, at the privilege of the writer [E1](https://bugbountylibrary.com/r/blog%3Asecurifera-com-blog-2024-05-02-okta-verify-for-windows-remote-code-execution-cve-2024-0980.md)[E2](https://bugbountylibrary.com/r/h1%3A2995025.md).

## Where it shows up
- Updaters/installers that derive a filename from a download URL and combine it with a program or temp directory [E1](https://bugbountylibrary.com/r/blog%3Asecurifera-com-blog-2024-05-02-okta-verify-for-windows-remote-code-execution-cve-2024-0980.md).
- Debug/inspector commands (e.g. live-reload over WebSocket) that fetch a remote file into a local folder using the remote name [E2](https://bugbountylibrary.com/r/h1%3A2995025.md).
- Raw concatenation of a base folder with `path.fileName()` or similar, with no canonicalization [E2](https://bugbountylibrary.com/r/h1%3A2995025.md).
- Rendered documents that load an external control/object by URL, where the engine resolves the control path without validating it stays inside the intended location [E3](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-formbook-adopts-cab-less-approach.md).
- Any named-pipe or IPC handler that accepts a path-like field from a lower-privileged caller [E1](https://bugbountylibrary.com/r/blog%3Asecurifera-com-blog-2024-05-02-okta-verify-for-windows-remote-code-execution-cve-2024-0980.md).

## How to review
Find every place a privileged process turns untrusted text into a filesystem path. The invariant: after resolution, the final canonical path must still be inside the intended base directory. Check that the code (a) rejects or strips rooted/absolute inputs and drive letters, (b) rejects `..` segments, and (c) compares the fully normalized result against the base prefix rather than trusting the join. For `Path.Combine`, confirm the second argument is guaranteed relative. For URL-derived names, confirm only a sanitized leaf is used, not the raw segment. For document/control loading, confirm the resolved control path is confined to the expected directory [E3](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-formbook-adopts-cab-less-approach.md).

## How finders spotted it
- Enumerated local services with Procmon, noticed a SYSTEM service, inferred .NET from its `.config`, decompiled with dotPeek, and traced JSON update metadata into `Path.Combine` with a user-controlled URL filename [E1](https://bugbountylibrary.com/r/blog%3Asecurifera-com-blog-2024-05-02-okta-verify-for-windows-remote-code-execution-cve-2024-0980.md).
- After an earlier inspector fix, re-reviewed all sibling inspector commands, saw `live_reload` accepts remote files, and read `fetchAndAnnounce()` to find a raw folder+filename concatenation [E2](https://bugbountylibrary.com/r/h1%3A2995025.md).
- Threat-hunted malicious attachments, then pivoted on the sender address in VirusTotal to cluster samples and decode OLE relationship targets to recover the control URL [E3](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-formbook-adopts-cab-less-approach.md).

## Variants seen
- Full Windows path with backslashes embedded in a URL segment overriding the parent folder via `Path.Combine` [E1](https://bugbountylibrary.com/r/blog%3Asecurifera-com-blog-2024-05-02-okta-verify-for-windows-remote-code-execution-cve-2024-0980.md).
- `..\..` traversal in a remote filename concatenated to a temp path [E2](https://bugbountylibrary.com/r/h1%3A2995025.md).
- Directory traversal in an engine resolving an externally linked ActiveX control path [E3](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-formbook-adopts-cab-less-approach.md).

## Impact and severity
Arbitrary file write as SYSTEM or the app's privilege, chained to DLL hijack for code execution [E1](https://bugbountylibrary.com/r/blog%3Asecurifera-com-blog-2024-05-02-okta-verify-for-windows-remote-code-execution-cve-2024-0980.md)[E2](https://bugbountylibrary.com/r/h1%3A2995025.md); in the Office case, a multi-stage chain ending in an info-stealer [E3](https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-formbook-adopts-cab-less-approach.md). Severity rises with writer privilege and with a reliable hijack target in the writable location.

## Seen in real software
Open-source packages and projects, and products, where this pattern was found. If the target runs one, compare the version it runs with the fix.
- **Okta Verify for Windows** (Okta.AutoUpdate.Executor) (version not stated): Okta Verify for Windows Remote Code Execution – CVE-2024-0980 (CVE-2024-0980). Report: https://bugbountylibrary.com/r/blog%3Asecurifera-com-blog-2024-05-02-okta-verify-for-windows-remote-code-execution-cve-2024-0980.md

## Evidence
- E1: https://bugbountylibrary.com/r/blog%3Asecurifera-com-blog-2024-05-02-okta-verify-for-windows-remote-code-execution-cve-2024-0980.md
- E2: https://bugbountylibrary.com/r/h1%3A2995025.md
- E3: https://bugbountylibrary.com/r/blog%3Aelastic-co-security-labs-threat-command-formbook-adopts-cab-less-approach.md
