Skip to content

test(utils): Add prototype pollution regression tests#2870

Open
mingcheng wants to merge 1 commit into
antvis:masterfrom
mingcheng:chore/add-prototype-pollution-tests
Open

test(utils): Add prototype pollution regression tests#2870
mingcheng wants to merge 1 commit into
antvis:masterfrom
mingcheng:chore/add-prototype-pollution-tests

Conversation

@mingcheng

Copy link
Copy Markdown
Member

改动描述

  • Add pp-check.spec.ts to guard lodash-adapter merge functions
  • Verify merge and mergeWith ignore __proto__ payloads
  • Verify constructor.prototype payloads do not pollute Object.prototype
  • Ensure legitimate deep merging still works as expected

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 工作流程
  • 版本更新
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

#2861

💡 需求背景和解决方案

📝 更新日志

语言 更新描述
🇺🇸 英文 X
🇨🇳 中文

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3924c1b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces regression tests in pp-check.spec.ts to prevent prototype pollution vulnerabilities in lodashUtil.merge and lodashUtil.mergeWith. The feedback suggests enhancing test coverage by adding a constructor.prototype pollution test for mergeWith and unifying the assertions to explicitly check Object.prototype across all test cases.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/utils/__tests__/pp-check.spec.ts
- Add `pp-check.spec.ts` to guard `lodash-adapter` merge functions
- Verify `merge` and `mergeWith` ignore `__proto__` payloads
- Verify `constructor.prototype` payloads do not pollute `Object.prototype`
- Ensure legitimate deep merging still works as expected

Signed-off-by: mingcheng <mingcheng@apache.org>
@mingcheng mingcheng force-pushed the chore/add-prototype-pollution-tests branch from be12b3e to 3924c1b Compare July 8, 2026 03:52
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