Skip to content

Security: Insecure deserialization of untrusted network data using pickle#1135

Open
tuanaiseo wants to merge 1 commit intozyddnys:mainfrom
tuanaiseo:contribai/fix/security/insecure-deserialization-of-untrusted-ne
Open

Security: Insecure deserialization of untrusted network data using pickle#1135
tuanaiseo wants to merge 1 commit intozyddnys:mainfrom
tuanaiseo:contribai/fix/security/insecure-deserialization-of-untrusted-ne

Conversation

@tuanaiseo
Copy link
Copy Markdown

Problem

The server deserializes data from HTTP responses with pickle.loads(await response.read()). If the upstream endpoint is compromised or attacker-controlled, this enables arbitrary code execution during deserialization.

Severity: critical
File: server/sent_data_internal.py

Solution

Do not use pickle for network payloads. Replace with a safe format (JSON/msgpack/protobuf) and strict schema validation. If binary transport is required, use signed payloads plus allowlisted types and never deserialize untrusted bytes directly.

Changes

  • server/sent_data_internal.py (modified)

Testing

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

The server deserializes data from HTTP responses with `pickle.loads(await response.read())`. If the upstream endpoint is compromised or attacker-controlled, this enables arbitrary code execution during deserialization.

Affected files: sent_data_internal.py

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
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