Skip to content

fix: harden bundler overrides against prototype pollution#2359

Draft
mcollina wants to merge 1 commit intomainfrom
fix/bundler-overrides-prototype-pollution
Draft

fix: harden bundler overrides against prototype pollution#2359
mcollina wants to merge 1 commit intomainfrom
fix/bundler-overrides-prototype-pollution

Conversation

@mcollina
Copy link
Member

@mcollina mcollina commented Dec 3, 2025

Summary

  • Use Object.prototype.hasOwnProperty.call instead of in operator to check for __bundlerPathsOverrides
  • Use structuredClone to snapshot overrides at module load time, preventing runtime manipulation
  • Refactor bundler tests into separate files so __bundlerPathsOverrides is set before pino is loaded

Test plan

  • All existing tests pass
  • Verify bundler override functionality works correctly
  • Verify prototype pollution attack is mitigated

🤖 Generated with Claude Code

- Use Object.prototype.hasOwnProperty.call instead of 'in' operator
- Use structuredClone to snapshot overrides at module load time
- Refactor bundler tests into separate files so __bundlerPathsOverrides
  is set before pino is loaded

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <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