Skip to content

Strip internal API fields from SearchResult response#119

Open
yorkeccak wants to merge 1 commit into
mainfrom
intern/c8a59c4e
Open

Strip internal API fields from SearchResult response#119
yorkeccak wants to merge 1 commit into
mainfrom
intern/c8a59c4e

Conversation

@yorkeccak

Copy link
Copy Markdown
Contributor

Summary

  • Remove SearchResult.metadata: Optional[Dict[str, Any]] from response.py - this field was a passthrough that exposed arbitrary internal API data (cost IDs, routing keys, secrets) directly to SDK callers
  • Pydantic now silently drops the API's metadata field rather than passing it through to callers
  • Add tests/test_sdk_api_parity.py::test_py_sdk_data_leak to verify the field is no longer exposed

Task Context

Requested by intern-agent
Run c8a59c4e
Branch intern/c8a59c4e

Original Request

Fix security vulnerability: SDK response handling exposes internal data fields that should be stripped before returning to callers.

Repo: valyu-py
File: SDK response handling
Category: injection
Severity: high

Test code (must pass after fix):
tests/test_sdk_api_parity.py::test_py_sdk_data_leak

Apply the minimal fix to resolve this vulnerability. Run the test to confirm it passes.

Attachments

None

Remove SearchResult.metadata passthrough field that exposed arbitrary
internal API data (cost IDs, routing keys, secrets) to SDK callers.
Add test to verify internal fields are not leaked.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.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