Summary
PraisonAI's unauthenticated Jobs API may accept absolute or directory-traversing agent file paths and pass them to the job executor without enforcing a workspace boundary. A remote caller could use this behavior to read files accessible to the service account, including credentials, private keys, environment data, and other local information.
Affected context
The issue may occur in PraisonAI deployments where the Jobs API is reachable by unauthenticated remote clients and the agent_file value from POST /api/v1/runs is used to locate files. Risk is higher when the service account can read sensitive files outside the intended agent workspace and when no canonical-path or allowlist check is applied before file access.
Exploit preconditions
- Attack surface: The unauthenticated Jobs API endpoint that accepts run requests
- Required access: Network access to the API; no user authentication may be required
- Trigger point: Processing the
agent_filepath during job creation or execution - Why exploitation is possible: The supplied path may be absolute or traverse parent directories, while the executor lacks an enforced workspace allowlist or boundary check
Why this happens
The vulnerability results from treating a client-controlled filesystem path as trusted input. Without canonicalizing the path and verifying that the resolved location remains within an approved workspace, absolute paths or traversal sequences can direct file operations outside the intended directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Potential impact
- Exposure of credentials, private keys, tokens, or environment variables
- Disclosure of application configuration and local service data
- Increased opportunity for follow-on compromise using recovered secrets
- Broader information leakage based on the service account's filesystem permissions
General mitigation guidance
Mitigation generally focuses on reducing trust in client-provided paths and enforcing a narrow filesystem boundary.
Common defensive patterns include:
- Accepting workspace-relative identifiers rather than arbitrary filesystem paths
- Canonicalizing resolved paths before access and verifying they remain within an approved directory
- Enforcing an explicit allowlist of permitted files or workspace locations
- Rejecting absolute paths, traversal components, symbolic-link escapes, and unexpected path encodings
- Limiting the service account's read permissions and separating sensitive data from job workspaces
- Requiring authentication and authorization for job-submission interfaces where appropriate
How teams detect issues like this
Detection can combine static analysis, review, and runtime controls:
- Search for filesystem APIs that consume request-derived path values without canonicalization and boundary checks
- Review API handlers and job executors for missing workspace allowlists or authorization checks
- Use policy rules to flag unauthenticated endpoints that accept file paths
- Monitor requests for absolute paths, traversal patterns, unusual encodings, and access attempts outside approved workspaces
- Audit service-account permissions and file-access logs for reads of sensitive locations
- Automated code-review and security scanning tools may help identify untrusted path flows

