VisActor / VisActor/VUtil

Prototype Pollution in @visactor/vdataset

Open
#285 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
43
Forks
11
Avg merge
4m
Merged PRs (30d)
2

Description

Prototype Pollution in @visactor/vdataset

Summary

@visactor/vdataset (<= 1.0.23) is vulnerable to Prototype Pollution via @visactor/vdataset.simplify.

Description

The function(s) @visactor/vdataset.simplify in @visactor/vdataset do not properly restrict modifications to Object.prototype. When processing user-controlled input, an attacker can inject properties via __proto__ or constructor.prototype keys, polluting the prototype of all JavaScript objects in the application.

Attack vectors: __proto__`, `constructor.prototype

Proof of Concept

const target = require('@visactor/vdataset');

// 1. Pollute Object.prototype
const malicious = JSON.parse('{"__proto__":{"polluted":"yes"}}');
@visactor/vdataset.simplify({}, malicious);

// 2. Verify pollution
const obj = {};
console.log(obj.polluted); // "yes" - prototype is polluted
console.log('Vulnerable:', obj.polluted === 'yes');

Impact

Successful exploitation allows an attacker to:

  • Remote Code Execution (RCE) via child_process spawn injection or vm sandbox escape

Remediation

Add key filtering to prevent prototype pollution:

function isSafe(key) {
  return key !== '__proto__' && key !== 'constructor' && key !== 'prototype';
}

Or use Object.create(null) for target objects to prevent prototype chain access.

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the @visactor/vdataset.simplify entry point and reproduce the supplied JSON.parse proof of concept. Trace handling of proto and constructor.prototype, then add regression coverage showing Object.prototype remains unchanged after the fix.

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
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.