Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prototype Pollution Vulnerability Affecting redoc <=2.2.0 #2638

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KsAkira10
Copy link

#2499

What/Why/How?

This PR fixes the security flaw in the "mergeObjects" function that is in this issue 2499

Reference

#2499

Tests

test('should prevent prototype pollution', () => {
        const target = {};
        const source = JSON.parse('{"__proto__": {"polluted": "yes"}}');

        mergeObjects(target, source);

        expect(({} as any).polluted).toBeUndefined();
 });

Screenshots (optional)

Check yourself

  • Code is linted
  • Tested
  • All new/updated code is covered with tests

@KsAkira10 KsAkira10 requested a review from a team as a code owner January 2, 2025 16:40
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