Skip to content

test: prototype pollution regression tests - #24

Merged
maxholman[bot] merged 1 commit into
masterfrom
test/prototype-pollution
Sep 27, 2026
Merged

maxholman[bot] merged 1 commit into
masterfrom
test/prototype-pollution

Conversation

@maxholman

@maxholman maxholman Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

A hostile __proto__ or constructor key from a server response, an event stream, a header or a query cannot reach the global prototype or reshape what the client returns, and a change to the client's internals that would let one through fails the suite. The cases go through the public client only, so replacing the JSON parser, the event-stream parser, the query serializer or the header merge keeps them valid.

Merges after #23, which it is based on.

Verified by hand: replacing the header merge with key assignment fails the header case.

@maxholman
maxholman force-pushed the test/prototype-pollution branch from 530c12a to 4ab5bf9 Compare September 27, 2026 08:09
@maxholman
maxholman Bot changed the base branch from fix/stream-bytes to master September 27, 2026 11:30
Each case drives a hostile __proto__ or constructor key through json(),
send() or stream() and fails if the global prototype changes, so swapping a
parser, serializer or merge for one that assigns keys is caught.

Co-Authored-By: LLM <noreply@maxholman.dev>
@maxholman
maxholman Bot force-pushed the test/prototype-pollution branch from 4ab5bf9 to 743b994 Compare September 27, 2026 11:32
@maxholman maxholman changed the title test: guard the client's public surface against prototype pollution test: prototype pollution regression tests Sep 27, 2026
@maxholman
maxholman Bot merged commit 2a03785 into master Sep 27, 2026
5 checks passed
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