antvis / antvis/util

潜在的原型链污染漏洞

Open
#114 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
72
Forks
28
PR merge metrics
No merged PRs in 30d

Description

复现代码1:
```javascript
let deepMix = require("@antv/util").deepMix;

let BAD_JSON = JSON.parse('{"__proto__":{"test":123}}');

let obj = {};
deepMix(obj, BAD_JSON);

console.log({}.test); // 123
```

问题代码:
https://github.com/antvis/util/blob/c499a30265ccf6099fc6e23d123f04b547eeaf5d/src/lodash/deep-mix.ts#L42-L47

复现代码2:
```javascript
let set = require("@antv/util").set;

let obj = {};
set(obj, "__proto__.test", 123);

console.log({}.test); // 123
```

问题代码:
https://github.com/antvis/util/blob/c499a30265ccf6099fc6e23d123f04b547eeaf5d/src/lodash/set.ts#L5-L29

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the two JavaScript reproductions in the issue, then inspect src/lodash/deep-mix.ts lines 42-47 and src/lodash/set.ts lines 5-29. Verify both affected entry points no longer modify the shared object prototype through __proto__ input, and add regression coverage for the demonstrated cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.