NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · PyPI

GHSA-763v-5pjm-fx36: Strands Agents: Default FileSessionManager storage is world-readable on shared systems

mediumCVSS 4.0 5.7

The default FileSessionManager in strands-agents before 1.48.0 stores agent session data under /tmp/strands/sessions with permissions that follow the process umask. On a typical umask 022 system, other local users can read prompts, tool output and secrets in those files. Upgrade to strands-agents 1.48.0.

Published Oct 27, 2026 · Analysis Nov 1, 2026

What an attacker can do

FileSessionManager keeps conversation history and state as JSON files. Its default path is tempfile.gettempdir() joined with strands/sessions. The code creates directories and writes files without a private mode, so permissions depend on the umask. With umask 022, session directories are 0755 and session.json files are 0644. The reporter's reproduction on commit dd7b41de38cb showed exactly those modes, and a fake secret in the session was readable in the file.

Any other local account can read the files. They may hold prompts, model output, tool inputs and outputs, intermediate state and any secrets that pass through the agent. The advisory names shared developer machines, CI hosts, notebooks, jump boxes and multi-user GPU servers.

The attacker needs a local account on the same host, so the CVSS 4.0 vector has local access and low privileges. The effect is confidentiality only. Single-user laptops and isolated containers are largely unaffected.

Who is affected

strands-agents on pip, all versions below 1.48.0, when FileSessionManager is used with its default storage_dir. Setting storage_dir yourself to a private location avoids the default path. Check the version:

pip show strands-agents

Check existing sessions with ls -l /tmp/strands/sessions.

strands-agents

Ecosystem
PyPI
Affected
< 1.48.0
Fixed in
1.48.0
Check
pip show strands-agents

How to fix it

Upgrade to strands-agents 1.48.0:

pip install --upgrade "strands-agents>=1.48.0"

Pull request 2937 moves the default storage directory to ~/.strands/sessions, creates directories with mode 0700, writes through tempfile.mkstemp, and refuses symlinks. It does not migrate old sessions from /tmp. Delete or lock down /tmp/strands/sessions yourself, and rotate any secrets that passed through agent sessions on shared hosts.

How to tell if you were hit

Run find /tmp/strands -type f -perm -004 to list world-readable session files. Check access times on those files and the audit log for reads by other users. Review which secrets, tokens or credentials the agents on that host handled, since they may be stored in clear text in session.json.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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 is os.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 normal open(..., "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/strands and descendants with 0700.
  • Write session JSON atomically with 0600 permissions.
  • 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_dir explicitly when they need shared storage.

This was reproduced on commit dd7b41de38cb.

Credited to whyiug.

Questions

Does upgrading remove the old session files?

No. The fix changes the default to ~/.strands/sessions and does not migrate or delete sessions in /tmp. Remove or restrict the old directory yourself.

Am I affected if I set storage_dir explicitly?

The advisory concerns the default path under /tmp. A private directory you chose is not covered, but check its permissions, because the code relied on the umask.

Can a remote attacker use this?

No. It needs a local account on the same machine. The CVSS 4.0 vector has local attack vector and low privileges.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More PyPI vulnerabilities

All PyPI entries