Summary
Vibe-Trading before version 0.1.10 constructs the proposal file path by directly joining a caller-supplied proposal identifier with the broker proposals directory, without sanitization.
An admitted caller can use path traversal sequences and a separately uploaded JSON file to make the system load an attacker-controlled live trading mandate, resulting in unrestricted control of trading ceilings when certain validation is skipped.
Affected context
This vulnerability appears in the live trading mandate commit logic, where proposal identifiers are treated as trusted path fragments and joined with the broker proposals directory.
It is relevant in deployments that expose a proposal commit endpoint to authenticated or admitted callers and maintain a shared filesystem for uploaded proposal JSON files.
Risk increases when the mandate loader does not normalize or constrain paths to a specific directory and when ceilings or related safety limits are optional or can be omitted from mandates.
Exploit preconditions
- Attack surface: The mandate commit functionality, which accepts a proposal identifier and loads a corresponding JSON file.
- Required access: Caller must be admitted or authenticated and able to use the file upload endpoint to place JSON files in predictable filesystem locations.
- Trigger point: Providing a proposal identifier containing path traversal sequences (e.g.,
../) so the application resolves to the attacker's uploaded JSON file instead of a legitimate proposal. - Why exploitation is possible: The code joins the user-supplied identifier with the proposals directory without sanitization or canonicalization, and ceilings validation is skipped when ceilings are absent, allowing full control over the committed trading mandate.
Why this happens
The core issue maps to CWE-22: Path Traversal, where user-controlled input is used directly to construct filesystem paths without validation.
In the affected mandate commit function, a caller-supplied proposal identifier is concatenated with a base directory and used to load JSON content as an authoritative trading mandate.
Without checks to strip traversal segments, enforce a fixed directory, or validate file names against an allowlist, an attacker can escape the intended proposals directory.
The business logic further assumes that mandates missing ceilings are valid and skips safety checks, compounding the path traversal flaw with insecure default behavior.
Potential impact
- Attacker-controlled trading mandates may be loaded as if they were legitimate proposals.
- Trading ceilings and risk limits can be removed or weakened, potentially enabling unbounded trades.
- Unauthorized alteration of broker behavior and automated strategies could occur.
- Financial loss, regulatory exposure, or market manipulation may result from executing malicious mandates.
General mitigation guidance
Effective mitigation centers on constraining filesystem access and hardening mandate validation logic.
Recommended patterns include:
- Strictly validating proposal identifiers against an allowlist or well-defined format (e.g., UUIDs or numeric IDs) rather than accepting arbitrary path fragments.
- Resolving paths to their canonical form and enforcing that they remain within a designated proposals directory, rejecting inputs that attempt traversal.
- Decoupling business identifiers from filesystem names and using internal mappings for file resolution instead of direct user-controlled paths.
- Treating the absence of ceilings or other safety constraints as invalid and enforcing mandatory risk controls in mandate schemas.
- Applying least-privilege file access policies in the application layer so only intended directories are readable for mandate loading.
How teams detect issues like this
Organizations can identify similar vulnerabilities by:
- Running static analysis for direct use of user-controlled strings in filesystem APIs (e.g.,
open,os.path.join) without normalization or checks. - Reviewing code paths where identifiers or request parameters are converted to file names or directories, looking for missing validation and traversal prevention.
- Adding security-focused tests that attempt to supply
../and absolute path sequences as identifiers and verifying that such requests are rejected. - Employing automated review tools or CI checks that flag unsafe path construction patterns and mandate schemas lacking required risk constraints.

