Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@KsAkira10
Copy link
Contributor

#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
Copy link
Collaborator

@AlexVarchuk AlexVarchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AlexVarchuk
Copy link
Collaborator

@KsAkira10 thank you for the contribution. Merge it when you are ready.

@KsAkira10 KsAkira10 closed this Jan 28, 2025
@KsAkira10 KsAkira10 reopened this Jan 28, 2025
@KsAkira10
Copy link
Contributor Author

image

I'm without permission

@AlexVarchuk
Copy link
Collaborator

Oh, sorry. I'll merge

@AlexVarchuk AlexVarchuk merged commit 153ec7a into Redocly:main Jan 28, 2025
3 checks passed
@KsAkira10 KsAkira10 deleted the fix/2499-pollution-vulnerability branch January 28, 2025 21:30
@KsAkira10 KsAkira10 restored the fix/2499-pollution-vulnerability branch January 28, 2025 21:31
@ivankropyvnytskyi ivankropyvnytskyi mentioned this pull request Feb 7, 2025
3 tasks
schimini pushed a commit to schimini/redoc that referenced this pull request Oct 28, 2025
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.

2 participants