Skip to content

Security: Unsafe Pickle Usage in FileLogger#690

Open
tuanaiseo wants to merge 1 commit into
OpenPipe:mainfrom
tuanaiseo:contribai/fix/security/unsafe-pickle-usage-in-filelogger
Open

Security: Unsafe Pickle Usage in FileLogger#690
tuanaiseo wants to merge 1 commit into
OpenPipe:mainfrom
tuanaiseo:contribai/fix/security/unsafe-pickle-usage-in-filelogger

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

The FileLogger class in src/art/langgraph/logging.py uses pickle.dump and pickle.load to serialize and deserialize log entries. Pickle is unsafe for untrusted data as it can execute arbitrary code during deserialization. An attacker with write access to the pickle file or the ability to control log entries could achieve remote code execution.

Severity: high
File: src/art/langgraph/logging.py

Solution

Replace pickle with a safe serialization format like JSON, msgpack, or protobuf. If pickle must be used, implement integrity verification (e.g., HMAC) and restrict file permissions. Consider using json.dump/json.load instead of pickle.dump/pickle.load.

Changes

  • src/art/langgraph/logging.py (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

The FileLogger class in src/art/langgraph/logging.py uses pickle.dump and pickle.load to serialize and deserialize log entries. Pickle is unsafe for untrusted data as it can execute arbitrary code during deserialization. An attacker with write access to the pickle file or the ability to control log entries could achieve remote code execution.

Affected files: logging.py

Signed-off-by: tuanaiseo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant