Advisory

PYSEC-2026-3514

Details, part 2 of 2. The advisory

Details

Severity

Suggested severity: High.

Suggested CVSS v3.1:

Rationale:

  • AV: applies when an application exposes a PraisonAI agent over a network chat/API surface, which is a documented PraisonAI deployment pattern.
  • AC: no race, special environment, or complex path manipulation is required; an absolute readable path is sufficient.
  • PR: an unauthenticated or public-facing agent endpoint can be exploited without an account. Deployments that require authenticated chat/API access may score this as PR:L.
  • UI: the attacker directly supplies the prompt/tool argument to the exposed agent surface.
  • C: arbitrary readable host files can contain secrets or private data.
  • I/A: this report demonstrates read-only disclosure.

Remediation

Do not let artifact tools open arbitrary paths. Prefer stable artifact IDs over
raw filesystem paths in tool arguments.

Recommended fixes:

  1. Change tool schemas to accept artifact_id plus optional run_id and agent_id, then resolve those through the artifact store's metadata/index.
  2. If path arguments must remain for compatibility, resolve the path with Path(path).resolve() and reject it unless it is under artifact_store.base_dir.resolve().
  3. Require a valid artifact metadata sidecar for read helpers. Files not created by FileSystemArtifactStore.store() should not be readable through artifact tools.
  4. Apply the same containment check to load(), head(), tail(), grep(), chunk(), and delete().
  5. Avoid returning absolute host paths in prompt-visible artifact references when an opaque artifact ID would suffice.

Minimal containment helper:

def _resolve_artifact_path(self, path: str) -> Path:
    resolved = Path(path).expanduser().resolve()
    base = self.base_dir.resolve()
    try:
        resolved.relative_to(base)
    except ValueError as exc:
        raise PermissionError("Artifact path is outside artifact storage") from exc
    return resolved

This helper should be paired with metadata-sidecar validation so arbitrary
non-artifact files placed under the base directory are not automatically
treated as valid artifacts.

Sources & licences