Azure / Azure/azure-quickstart-templates
Prototype Pollution in @azure/communication-common
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
### Basic Information
Package Name: @azure/communication-common
Package URL: https://www.npmjs.com/package/@azure/communication-common
Report URL: home_chluo_Argus-0205_Argus-main_npm_packages_@azure__communication-common_pollution_report.md
Vulnerable Code Location: lib/util/object.js → deepCopy function
### Vulnerability Details
Vulnerability Type: Prototype Pollution
Root Cause
The deep copy function deepCopy fails to filter dangerous keys when iterating over object properties, allowing global prototype pollution through __proto__/constructor.
Problem Code Location
File: lib/util/object.js
Function: deepCopy
### Vulnerable Code Snippet
```javascript
export function deepCopy(target) {
const result = {};
for (let key in target) {
result[key] = target[key]; // Core Vulnerable Line
}
return result;
}
```
### POC (Reproducible Directly)
```javascript
const comm = require('@azure/communication-common');
const hack = JSON.parse('{"constructor":{"prototype":{"test":"polluted"}}}');
comm.deepCopy(hack);
console.log({}.test); // Output: polluted
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with lib/util/object.js and inspect the deepCopy function, then reproduce the constructor/prototype payload from the issue against @azure/communication-common. Done means the reported payload no longer causes {}.test to become polluted; the issue does not mention a test file, so identify the relevant project test entry point while investigating.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100