Strands Agents: Default FileSessionManager storage is world-readable on shared systemsGHSA-763v-5pjm-fx36
Fix: strands-agents/harness-sdk#2937GHSA-763v-5pjm-fx36 is a security vulnerability in strands-agents. A fix is available for strands-agents — see the affected versions and patch details below.
Real-World Exposure
strands-agentsReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
There is a local confidentiality issue in the default FileSessionManager storage behavior. By default it writes session data under /tmp/strands/sessions and relies on the process umask for directory and file permissions. On systems using the common umask 022, the session directories are 0755 and JSON files are 0644, so other local users can read persisted agent session data.
This matters on shared developer machines, CI hosts, notebooks, jump boxes, and multi-user GPU servers. Session storage is intended to persist conversation/history/state, so it can contain prompts, model output, tool inputs/outputs, intermediate state, and secrets that pass through the agent.
Relevant code:
strands-py/src/strands/session/file_session_manager.py:58: default storage path isos.path.join(tempfile.gettempdir(), "strands/sessions").strands-py/src/strands/session/file_session_manager.py:118: creates parent directories without a private mode.strands-py/src/strands/session/file_session_manager.py:121: writes JSON files via normalopen(..., "w").strands-py/src/strands/session/file_session_manager.py:131: creates session directories without a private mode.
Local reproduction with umask 022:
default_storage_dir= /tmp/strands/sessions
0o755 /tmp/strands/sessions
0o755 /tmp/strands/sessions/session_codex_perm_poc
0o644 /tmp/strands/sessions/session_codex_perm_poc/session.json
file_contains_secret= True
The fixture wrote a fake secret into the session dict to show that sensitive session fields are readable through the resulting file.
Suggested fixes:
- Use a private per-user data directory by default rather than
/tmp, or create/tmp/strandsand descendants with0700. - Write session JSON atomically with
0600permissions. - Consider refusing to use an existing default storage directory if it is not owned by the current user or is group/world accessible.
- Document that callers should set
storage_direxplicitly when they need shared storage.
This was reproduced on commit dd7b41de38cb.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | strands-agents | all versions | 1.48.0pip install --upgrade 'strands-agents==1.48.0' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for strands-agents, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update strands-agents to 1.48.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-763v-5pjm-fx36 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is GHSA-763v-5pjm-fx36 in your dependencies?
Find it across PyPI, including transitive dependencies.