@insaida/beacon 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.
- package/README.md +39 -0
- package/index.js +73 -0
- package/package.json +13 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @insaida/beacon
|
|
2
|
+
|
|
3
|
+
Canary package for security research.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
This package confirms whether a JavaScript runtime can successfully import, execute, and interact with third-party packages. It is used in authorized security research.
|
|
8
|
+
|
|
9
|
+
## What it does
|
|
10
|
+
|
|
11
|
+
1. Lists the contents of the current working directory
|
|
12
|
+
2. Writes a timestamped proof file (`.sandbox_canary_proof.txt`) to CWD
|
|
13
|
+
3. Exports results for programmatic verification
|
|
14
|
+
|
|
15
|
+
## What it does NOT do
|
|
16
|
+
|
|
17
|
+
- No network requests
|
|
18
|
+
- No system command execution
|
|
19
|
+
- No file access outside the current working directory
|
|
20
|
+
- No persistence mechanisms
|
|
21
|
+
- No obfuscation
|
|
22
|
+
|
|
23
|
+
The entire source is ~40 lines of straightforward JavaScript. Read it.
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { canary } from "@insaida/beacon";
|
|
29
|
+
console.log(canary.executed); // true
|
|
30
|
+
console.log(canary.writeSuccess); // true if CWD is writable
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Responsible Disclosure
|
|
34
|
+
|
|
35
|
+
This package is part of an authorized security research effort. If you have questions, contact the author.
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
MIT
|
package/index.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @insaida/beacon
|
|
3
|
+
*
|
|
4
|
+
* Security research canary package.
|
|
5
|
+
* Confirms package import and basic runtime capabilities
|
|
6
|
+
* in JavaScript execution environments.
|
|
7
|
+
*
|
|
8
|
+
* This package is intentionally simple and transparent.
|
|
9
|
+
* It performs no network requests, installs no hooks, and touches
|
|
10
|
+
* only the current working directory.
|
|
11
|
+
*
|
|
12
|
+
* Usage: import("npm:@insaida/sandbox-canary")
|
|
13
|
+
*
|
|
14
|
+
* What it does:
|
|
15
|
+
* 1. Reads the current working directory
|
|
16
|
+
* 2. Writes a timestamped canary file to CWD
|
|
17
|
+
* 3. Exports the result for programmatic verification
|
|
18
|
+
*
|
|
19
|
+
* Author: insaida (security researcher)
|
|
20
|
+
* License: MIT
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { readFileSync, writeFileSync, readdirSync } from "node:fs";
|
|
24
|
+
import { join } from "node:path";
|
|
25
|
+
|
|
26
|
+
const timestamp = new Date().toISOString();
|
|
27
|
+
const cwd = process.cwd();
|
|
28
|
+
const canaryPath = join(cwd, ".sandbox_canary_proof.txt");
|
|
29
|
+
|
|
30
|
+
// Step 1: List CWD contents
|
|
31
|
+
let cwdContents = [];
|
|
32
|
+
try {
|
|
33
|
+
cwdContents = readdirSync(cwd);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
cwdContents = [`error: ${e.message}`];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Step 2: Write canary proof file
|
|
39
|
+
let writeSuccess = false;
|
|
40
|
+
try {
|
|
41
|
+
writeFileSync(canaryPath, [
|
|
42
|
+
"=== SANDBOX CANARY ===",
|
|
43
|
+
`Timestamp: ${timestamp}`,
|
|
44
|
+
`CWD: ${cwd}`,
|
|
45
|
+
`PID: ${process.pid}`,
|
|
46
|
+
`Platform: ${process.platform} ${process.arch}`,
|
|
47
|
+
`CWD files: ${cwdContents.length}`,
|
|
48
|
+
"",
|
|
49
|
+
"This file was written by @insaida/beacon",
|
|
50
|
+
"as part of authorized security research.",
|
|
51
|
+
"=== END ==="
|
|
52
|
+
].join("\n"));
|
|
53
|
+
writeSuccess = true;
|
|
54
|
+
} catch (e) {
|
|
55
|
+
writeSuccess = false;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Step 3: Export results
|
|
59
|
+
export const canary = {
|
|
60
|
+
executed: true,
|
|
61
|
+
timestamp,
|
|
62
|
+
cwd,
|
|
63
|
+
pid: process.pid,
|
|
64
|
+
platform: `${process.platform}/${process.arch}`,
|
|
65
|
+
cwdFileCount: cwdContents.length,
|
|
66
|
+
writeSuccess,
|
|
67
|
+
canaryPath: writeSuccess ? canaryPath : null,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// Log for stdout capture
|
|
71
|
+
console.log("[CANARY] Package executed at", timestamp);
|
|
72
|
+
console.log("[CANARY] CWD:", cwd, `(${cwdContents.length} files)`);
|
|
73
|
+
console.log("[CANARY] Write proof:", writeSuccess ? canaryPath : "FAILED");
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@insaida/beacon",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Lightweight canary for security research — confirms package import, CWD access, and write capability in JavaScript runtimes.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"security-research",
|
|
9
|
+
"canary"
|
|
10
|
+
],
|
|
11
|
+
"author": "insaida",
|
|
12
|
+
"license": "MIT"
|
|
13
|
+
}
|