@nuxtjp/local-runtime 0.1.5 → 0.1.6

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.ja.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## 導入と使い方
8
8
 
9
- `0.1.1`はnpmで公開済みです。Node `^22.19.0`または`^24.11.0`、Nuxt `^4.5.1`、Vue `^3.5.40`を使用してください。
9
+ 公開版は `npm view @nuxtjp/local-runtime version` で確認してください。Nuxt `^4.6.2`、Vue `^3.5.40`、Node.js 22.19以降または24.11以降を使用します。
10
10
 
11
11
  ```sh
12
12
  npm install @nuxtjp/local-runtime
@@ -60,7 +60,7 @@ pnpm test
60
60
  pnpm build
61
61
  ```
62
62
 
63
- 検証入力はNuxt/kit/schema `4.5.1`、Vue `3.5.43`、Vitest `4.1.11`に固定しています。互換性のある依存修正でadvisoryを減らしましたが、残るadvisoryと未検証環境はリリース前に評価してください。Nodeとhostの最低条件はNuxtに合わせて引き上げています。
63
+ 検証用の依存と固定版はpackage.json・pnpm-lock.yamlを正本とします。独立consumer CIで実配布物と共通セキュリティ処理を検証し、他の環境の受入れとは区別します。
64
64
  module/client API、loopback endpointの規則、明示接続の動作、ライセンス条件は維持しています。
65
65
  ローカルTGZの試験は配布物の動作確認であり、registryの配布確認とは別です。操作・配備・公開には、それぞれの権限と設定が必要です。
66
66
 
package/README.md CHANGED
@@ -6,7 +6,7 @@ Connect a browser interface to one explicitly configured local Rust runtime, aft
6
6
 
7
7
  ## Install and use
8
8
 
9
- Install the package version `0.1.4` after it is available on npm. Use Node `^22.19.0` or `^24.11.0`, Nuxt `^4.5.1` and Vue `^3.5.40`.
9
+ Install the published version identified by `npm view @nuxtjp/local-runtime version`. Use Nuxt `^4.6.2`, Vue `^3.5.40`, and Node.js 22.19+ or 24.11+.
10
10
 
11
11
  ```sh
12
12
  npm install @nuxtjp/local-runtime
@@ -60,7 +60,7 @@ pnpm test
60
60
  pnpm build
61
61
  ```
62
62
 
63
- The verification inputs pin Nuxt/kit/schema to `4.5.2`, Vue to `3.5.43` and Vitest to `4.1.11`. Compatible dependency fixes remove advisories; assess remaining advisories and untested environments before a release. Node and host compatibility floors were raised to match Nuxt.
63
+ The exact verification dependencies are declared in package.json and pnpm-lock.yaml. Consumer CI exercises the reviewed archive and shared security tool; other environments require their own acceptance.
64
64
  The module/client API, loopback endpoint rules, explicit connection behavior and license terms are retained.
65
65
  A local TGZ test proves archive behavior, not registry availability. Operations, deployment and publication require their own permissions and settings.
66
66
 
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^4.5.1"
6
6
  },
7
- "version": "0.1.5",
7
+ "version": "0.1.6",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "unknown"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtjp/local-runtime",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Fail-closed Nuxt client for a loopback local runtime",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -41,21 +41,22 @@
41
41
  "./schema": "./schemas/local-runtime-v1.schema.json"
42
42
  },
43
43
  "peerDependencies": {
44
- "nuxt": "^4.5.1",
44
+ "nuxt": "^4.6.2",
45
45
  "vue": "^3.5.40"
46
46
  },
47
47
  "dependencies": {
48
- "@nuxt/kit": "4.6.1",
49
- "@nuxt/schema": "4.6.1"
48
+ "@nuxt/kit": "4.6.2",
49
+ "@nuxt/schema": "4.6.2",
50
+ "@nuxtjp/dependency-security": "0.1.2"
50
51
  },
51
52
  "devDependencies": {
52
53
  "@nuxt/module-builder": "1.0.3",
53
54
  "@types/node": "24.12.0",
54
55
  "ajv": "8.20.0",
55
- "nuxt": "4.6.1",
56
+ "nuxt": "4.6.2",
56
57
  "typescript": "5.9.3",
57
- "vitest": "5.0.3",
58
- "vue": "3.5.43",
58
+ "vitest": "5.0.5",
59
+ "vue": "3.5.44",
59
60
  "vue-tsc": "3.3.13"
60
61
  },
61
62
  "repository": {
@@ -71,11 +72,19 @@
71
72
  "registry": "https://registry.npmjs.org",
72
73
  "provenance": true
73
74
  },
75
+ "keywords": [
76
+ "nuxt",
77
+ "rust",
78
+ "local-first",
79
+ "ipc",
80
+ "developer-tools"
81
+ ],
74
82
  "scripts": {
75
- "build": "nuxt-module-build build && nuxt build playground",
83
+ "build": "pnpm run build:security && nuxt-module-build build && nuxt build playground",
76
84
  "typecheck": "vue-tsc --noEmit --project tsconfig.json",
77
85
  "test": "vitest run && pnpm run test:dependency-security && pnpm run test:consumer-security",
78
- "test:dependency-security": "node --test scripts/dependency-security.check.cjs",
79
- "test:consumer-security": "node --test scripts/consumer-security.check.mjs"
86
+ "test:dependency-security": "node security/dependency-security.check.cjs",
87
+ "test:consumer-security": "node --test scripts/consumer-security.check.mts",
88
+ "build:security": "tsc -p tsconfig.security.json"
80
89
  }
81
90
  }
@@ -1,23 +1,13 @@
1
- # Dependency security backports
1
+ # Dependency security maintenance
2
2
 
3
- Two upstream dependencies have no fixed release: braces 3.0.3 (GHSA-vfj7-8cjw-p6xm) and node-forge 1.4.0 (GHSA-86w9-cpqp-85rv). The root configuration also requires simple-git 4.0.2, @simple-git/argv-parser 2.0.1 and esbuild 0.28.2 from the public registry to address their upstream advisories. Exact versions are maintained in `dependency-versions.json`. The included patches bound brace AST recursion and reject malformed RSA DigestAlgorithm parameters. Regression tests cover ordinary behavior and the malicious input shapes.
4
-
5
- The package is distributed through npm. A consumer must use pnpm 10 and explicitly configure the reviewed backports at its project root. Dependency packages cannot impose root-level npm overrides or pnpm patches on a consuming application. Installing this module alone does not apply the patches.
3
+ `@nuxtjp/dependency-security` owns the reviewed policy, patches, installed dependency resolver and regression checks. This module depends on that peer-free package; its `security/apply.mjs` and `security/dependency-security.check.cjs` paths are generated compatibility entry points and contain no independent policy.
6
4
 
7
5
  ```sh
8
- node node_modules/@nuxtjp/local-runtime/security/apply.mjs --project-root . --apply
6
+ pnpm exec nuxtjp-security-config --project-root . --apply
9
7
  pnpm install --no-frozen-lockfile
10
8
  pnpm install --frozen-lockfile
9
+ pnpm exec nuxtjp-security-check --project-root .
10
+ pnpm audit --json
11
11
  ```
12
12
 
13
- Commit the generated `.nuxtjp-security/*.patch`, `package.json`, and lockfile in your application. The command does not run installs, access the network, or replace an existing conflicting patch. It preserves unrelated pnpm settings. Each root application must apply the patches, including CI checkouts.
14
-
15
- Run `node node_modules/@nuxtjp/local-runtime/security/dependency-security.check.cjs` after installing the locked project to verify that the actual resolved dependencies reject the affected inputs. These are backports, not upstream fixed versions. Version-only advisory tools still report the two vulnerable upstream versions; retain their findings and link the lockfile/patch hashes and regression results. Reapply and reverify when dependency versions change. npm-only consumers require a separately reviewed override distribution; they are not certified by this pnpm procedure.
16
-
17
- The RSA test creates an ephemeral key in memory and never reads a user key. Patches contain code only and do not include credentials, customer content, or private endpoints.
18
-
19
- Run `pnpm audit --json` on the installed application and retain the report. Only the two backported braces/node-forge advisories may remain; any other advisory, including simple-git, its argument parser, or esbuild, blocks validation. Run the dependency regression command on each install to reject missing or older active versions.
20
-
21
- The code patch inputs retain third-party notices in `LICENSE-braces` (MIT) and `LICENSE-node-forge`. The original dependencies remain registry packages; the shipped files configure and test the consumer rather than silently replacing its package manager.
22
-
23
- The simple-git 4.0.2 compatibility patch restores only the legacy ESM default factory used by Nuxt devtools. It aliases the existing, fixed `simpleGit` factory and does not change argument validation, executable selection, or Git execution. The named factory remains identical. `LICENSE-simple-git` retains its upstream MIT notice. A fresh consumer build and type check with devtools enabled are mandatory release checks.
13
+ Installation does not apply patches. Select the application explicitly and commit its generated patches, manifest and lockfile. Configuration rejects conflicts; only the shared policy's tested backport advisories may remain visible. An application build and type check with devtools enabled are required separately. Existing LICENSE-braces, LICENSE-node-forge and LICENSE-simple-git attribution is retained. Root `patches/` files are this repository's own build inputs, not another distributed security implementation.
@@ -1,19 +1,18 @@
1
1
  #!/usr/bin/env node
2
- /** Apply reviewed Nuxt dependency backports to an explicitly selected pnpm project. */
3
- import { fileURLToPath } from 'node:url'
4
- import { dirname } from 'node:path'
5
- import { applySecurityPatches } from './project.mjs'
6
-
7
- const args = process.argv.slice(2)
2
+ // Compatibility CLI: the shared tool owns policy, patches and validation.
3
+ import { applySecurityPatches } from '@nuxtjp/dependency-security';
4
+ const args = process.argv.slice(2);
8
5
  if (args.length !== 3 || args[0] !== '--project-root' || args[2] !== '--apply') {
9
- console.error('Usage: node apply.mjs --project-root PROJECT --apply')
10
- process.exitCode = 2
11
- } else {
12
- try {
13
- applySecurityPatches(args[1], dirname(fileURLToPath(import.meta.url)))
14
- console.log('Reviewed backports configured. Run pnpm install --no-frozen-lockfile to refresh the lockfile.')
15
- } catch (error) {
16
- console.error(error.message)
17
- process.exitCode = 1
18
- }
6
+ console.error('Usage: node apply.mjs --project-root PROJECT --apply');
7
+ process.exitCode = 2;
8
+ }
9
+ else {
10
+ try {
11
+ applySecurityPatches(args[1]);
12
+ console.log('Reviewed backports configured. Run pnpm install --no-frozen-lockfile to refresh the lockfile.');
13
+ }
14
+ catch {
15
+ console.error('Selected project configuration could not be applied; review manifest and patch conflicts.');
16
+ process.exitCode = 1;
17
+ }
19
18
  }
@@ -1,70 +1,9 @@
1
- const assert = require('node:assert/strict');
2
- const { test } = require('node:test');
3
- const { createRequire } = require('node:module');
4
- const { generateKeyPairSync, sign, privateEncrypt, constants } = require('node:crypto');
5
- const path = require('node:path');
6
- const fs = require('node:fs');
7
- function dependency(name, version) {
8
- const { installedDependencies } = require('./resolved-dependency.cjs');
9
- const matches = installedDependencies(process.cwd(), name, version);
10
- assert.equal(matches.length, 1, 'Expected one active locked dependency implementation');
11
- return createRequire(matches[0])(name);
12
- }
13
- const braces = dependency('braces', '3.0.3');
14
- const forge = dependency('node-forge', '1.4.0');
15
- test('brace compilation, expansion and stringification retain ordinary behavior', () => {
16
- assert.equal(braces.compile('src/{a,b}.vue'), 'src/(a|b).vue');
17
- assert.deepEqual(braces.expand('src/{a,b}.vue'), ['src/a.vue', 'src/b.vue']);
18
- assert.equal(braces.stringify(braces.parse('src/{a,b}.vue')), 'src/{a,b}.vue');
19
- assert.equal(braces.compile('src/\\{a,b\\}.vue'), 'src/{a,b}.vue');
20
- });
21
- test('deep brace, parenthesis and caller AST inputs reject before stack exhaustion', () => {
22
- for (const pattern of ['{'.repeat(6000) + 'a,b' + '}'.repeat(6000), '('.repeat(6000) + 'x' + ')'.repeat(6000), '{'.repeat(6000) + 'x']) {
23
- for (const fn of [braces.compile, braces.expand, braces.stringify, braces.parse]) assert.throws(() => fn(pattern), SyntaxError);
24
- }
25
- let ast = { type: 'text', value: 'x' };
26
- for (let i = 0; i < 6000; i++) ast = { type: 'root', nodes: [ast] };
27
- for (const fn of [braces.compile, braces.expand, braces.stringify]) assert.throws(() => fn(ast), SyntaxError);
28
- const cyclic = { type: 'root', nodes: [] }; cyclic.nodes.push(cyclic);
29
- assert.throws(() => braces.compile(cyclic), SyntaxError);
30
- });
31
- test('RSA verifier accepts standard signatures and rejects extra or malformed DigestAlgorithm elements', () => {
32
- const keys = generateKeyPairSync('rsa', { modulusLength: 2048 });
33
- const publicKey = forge.pki.publicKeyFromPem(keys.publicKey.export({ type: 'spki', format: 'pem' }));
34
- const data = Buffer.from('never-issued security regression fixture');
35
- const md = forge.md.sha256.create(); md.update(data.toString('binary'));
36
- const digest = md.digest().getBytes();
37
- assert.equal(publicKey.verify(digest, sign('sha256', data, keys.privateKey).toString('binary')), true);
38
- const a = forge.asn1;
39
- const oid = () => a.create(a.Class.UNIVERSAL, a.Type.OID, false, a.oidToDer(forge.oids.sha256).getBytes());
40
- const nil = value => a.create(a.Class.UNIVERSAL, a.Type.NULL, false, value);
41
- for (const parameters of [[oid(), nil(''), oid()], [oid(), a.create(a.Class.UNIVERSAL, a.Type.SEQUENCE, true, [oid()])], [oid(), nil('x')]]) {
42
- const info = a.create(a.Class.UNIVERSAL, a.Type.SEQUENCE, true, [a.create(a.Class.UNIVERSAL, a.Type.SEQUENCE, true, parameters), a.create(a.Class.UNIVERSAL, a.Type.OCTETSTRING, false, digest)]);
43
- const encoded = Buffer.from(a.toDer(info).getBytes(), 'binary');
44
- const signature = privateEncrypt({ key: keys.privateKey, padding: constants.RSA_PKCS1_PADDING }, encoded).toString('binary');
45
- let accepted = false;
46
- try { accepted = publicKey.verify(digest, signature); } catch { /* Rejection is the expected result for a malformed signature. */ }
47
- assert.equal(accepted, false, 'Malformed algorithm must not verify');
48
- }
49
- });
50
-
51
- test('active dependency graph uses every required upstream security version', () => {
52
- const policy = JSON.parse(fs.readFileSync(path.join(__dirname, 'dependency-versions.json'), 'utf8'));
53
- const { installedDependencies } = require('./resolved-dependency.cjs');
54
- for (const [name, version] of Object.entries(policy.overrides)) {
55
- const matches = installedDependencies(process.cwd(), name);
56
- assert.ok(matches.length > 0, 'Required dependency is absent: ' + name);
57
- for (const manifest of matches) assert.equal(JSON.parse(fs.readFileSync(manifest, 'utf8')).version, version, name);
58
- }
59
- });
60
-
61
- // Preserve the ESM entry point expected by current Nuxt devtools without downgrading Git protections.
62
- test('fixed simple-git retains named and legacy ESM factory exports', async () => {
63
- const { pathToFileURL } = require('node:url');
64
- const { installedDependencies } = require('./resolved-dependency.cjs');
65
- for (const manifest of installedDependencies(process.cwd(), 'simple-git', '4.0.2')) {
66
- const module = await import(pathToFileURL(path.join(path.dirname(manifest), 'dist/index.mjs')).href);
67
- assert.equal(typeof module.simpleGit, 'function');
68
- assert.equal(module.default, module.simpleGit);
69
- }
70
- });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ // Compatibility entry point; regressions execute only after explicit invocation.
4
+ void import('@nuxtjp/dependency-security').then(({ verifyProject }) => {
5
+ const result = verifyProject(process.cwd());
6
+ process.stdout.write(result.stdout);
7
+ process.stderr.write(result.stderr);
8
+ process.exitCode = result.exitCode;
9
+ }).catch(() => { console.error('Selected dependency graph cannot be verified'); process.exitCode = 2; });
@@ -1,76 +1,2 @@
1
- /** Configure caller-owned pnpm backports without executing installs or changing unrelated settings. */
2
- import { existsSync, lstatSync, readFileSync, mkdirSync, writeFileSync, renameSync, unlinkSync, realpathSync } from 'node:fs'
3
- import { join, resolve } from 'node:path'
4
- import { randomUUID } from 'node:crypto'
5
-
6
- const patches = ['braces@3.0.3', 'node-forge@1.4.0', 'simple-git@4.0.2']
7
- function regular(path) {
8
- const stat = lstatSync(path)
9
- if (stat.isSymbolicLink() || !stat.isFile() || stat.size > 1024 * 1024) {
10
- throw new Error('Expected a bounded regular project or patch file')
11
- }
12
- return readFileSync(path)
13
- }
14
- function object(value) {
15
- return value !== null && typeof value === 'object' && !Array.isArray(value)
16
- }
17
-
18
- /** Reject conflicting patches and links before mutating a project. No network access occurs. */
19
- export function applySecurityPatches(project, source) {
20
- const root = realpathSync(resolve(project))
21
- const manifest = join(root, 'package.json')
22
- const original = regular(manifest)
23
- const data = JSON.parse(original)
24
- if (!object(data) || (data.pnpm !== undefined && !object(data.pnpm))) {
25
- throw new Error('Expected a package manifest with object-valued pnpm settings')
26
- }
27
- const pnpm = data.pnpm ?? {}
28
- const existing = pnpm.patchedDependencies ?? {}
29
- if (!object(existing)) throw new Error('Expected object-valued patchedDependencies')
30
- const pinned = JSON.parse(regular(join(source, 'dependency-versions.json')))
31
- if (pinned.schemaVersion !== 1 || !object(pinned.overrides)) throw new Error('Invalid dependency version policy')
32
- const overrides = pnpm.overrides ?? {}
33
- if (!object(overrides)) throw new Error('Expected object-valued dependency overrides')
34
- for (const [name, version] of Object.entries(pinned.overrides)) {
35
- if (!/^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/.test(name) || !/^\d+\.\d+\.\d+$/.test(version)) {
36
- throw new Error('Exact registry package versions required')
37
- }
38
- for (const [selector, target] of Object.entries(overrides)) {
39
- const dependency = selector.split('>').at(-1)
40
- if ((dependency === name || dependency.startsWith(name + '@')) && target !== version) {
41
- throw new Error('A dependency override conflicts; review it before applying')
42
- }
43
- }
44
- }
45
- const dir = join(root, '.nuxtjp-security')
46
- if (existsSync(dir) && (lstatSync(dir).isSymbolicLink() || !lstatSync(dir).isDirectory())) {
47
- throw new Error('Security patch directory must be a real directory')
48
- }
49
- const inputs = patches.map(name => {
50
- const relative = `.nuxtjp-security/${name}.patch`
51
- if (existing[name] !== undefined && existing[name] !== relative) {
52
- throw new Error('An existing dependency patch conflicts; review it before applying')
53
- }
54
- const bytes = regular(join(source, 'patches', `${name}.patch`))
55
- const target = join(root, relative)
56
- if (existsSync(target) && !regular(target).equals(bytes)) {
57
- throw new Error('An existing patch differs; no files were overwritten')
58
- }
59
- return { name, relative, bytes, target }
60
- })
61
- if (!readFileSync(manifest).equals(original)) throw new Error('Manifest changed during preparation')
62
- mkdirSync(dir, { recursive: true })
63
- for (const patch of inputs) {
64
- if (!existsSync(patch.target)) writeFileSync(patch.target, patch.bytes, { flag: 'wx' })
65
- existing[patch.name] = patch.relative
66
- }
67
- data.pnpm = { ...pnpm, patchedDependencies: existing, overrides: { ...overrides, ...pinned.overrides } }
68
- const temporary = join(root, `.nuxtjp-manifest-${randomUUID()}.tmp`)
69
- try {
70
- writeFileSync(temporary, JSON.stringify(data, null, 2) + '\n', { flag: 'wx' })
71
- if (!readFileSync(manifest).equals(original)) throw new Error('Manifest changed; retry after review')
72
- renameSync(temporary, manifest)
73
- } finally {
74
- if (existsSync(temporary)) unlinkSync(temporary)
75
- }
76
- }
1
+ // Generated compatibility outputs delegate to the single versioned security owner.
2
+ export { applySecurityPatches } from "@nuxtjp/dependency-security";
@@ -1,40 +1,4 @@
1
- /** Resolve a dependency through the installed application graph, ignoring unused store entries. */
2
- const fs = require('node:fs');
3
- const path = require('node:path');
4
- const { createRequire } = require('node:module');
5
-
6
- function installedDependencies(root, target, version) {
7
- root = fs.realpathSync(root);
8
- const pending = [path.join(root, 'package.json')];
9
- const seen = new Set();
10
- const found = new Set();
11
- while (pending.length) {
12
- if (seen.size > 5000) throw new Error('Installed dependency graph exceeds verification budget');
13
- const file = pending.pop();
14
- if (seen.has(file)) continue;
15
- seen.add(file);
16
- const data = JSON.parse(fs.readFileSync(file, 'utf8'));
17
- if (data.name === target) {
18
- if (version !== undefined && data.version !== version) throw new Error('Dependency version changed; review its security patch');
19
- found.add(file);
20
- }
21
- const request = createRequire(file);
22
- const names = Object.keys({ ...data.dependencies, ...data.optionalDependencies, ...data.peerDependencies,
23
- ...(file === path.join(root, 'package.json') ? data.devDependencies : {}) });
24
- for (const name of names) {
25
- for (const location of request.resolve.paths(name) ?? []) {
26
- const candidate = path.join(location, name, 'package.json');
27
- if (!fs.existsSync(candidate)) continue;
28
- const real = fs.realpathSync(candidate);
29
- if (!real.startsWith(path.join(root, 'node_modules') + path.sep)) {
30
- throw new Error('Dependency resolves outside the selected project; select the workspace root');
31
- }
32
- pending.push(real);
33
- break;
34
- }
35
- }
36
- }
37
- if (found.size === 0) throw new Error('Dependency not present in the installed application graph');
38
- return [...found].sort();
39
- }
40
- module.exports = { installedDependencies };
1
+ "use strict";
2
+ // The shared maintenance tool owns active dependency resolution.
3
+ const resolver = require("@nuxtjp/dependency-security/installed-dependencies");
4
+ module.exports = resolver;
@@ -1,12 +0,0 @@
1
- {
2
- "schemaVersion": 1,
3
- "overrides": {
4
- "simple-git": "4.0.2",
5
- "@simple-git/argv-parser": "2.0.1",
6
- "esbuild": "0.28.2"
7
- },
8
- "backportedAdvisories": [
9
- "GHSA-vfj7-8cjw-p6xm",
10
- "GHSA-86w9-cpqp-85rv"
11
- ]
12
- }
@@ -1,92 +0,0 @@
1
- diff --git a/lib/depth-guard.js b/lib/depth-guard.js
2
- new file mode 100644
3
- --- /dev/null
4
- +++ b/lib/depth-guard.js
5
- @@ -0,0 +1,19 @@
6
- +'use strict';
7
- +
8
- +// Wonderland security backport: bound recursive walkers, including caller ASTs.
9
- +module.exports = ast => {
10
- + const pending = [[ast, 0]];
11
- + const seen = new Set();
12
- + let count = 0;
13
- + while (pending.length) {
14
- + const [node, depth] = pending.pop();
15
- + if (depth > 64 || ++count > 100000 || seen.has(node)) {
16
- + throw new SyntaxError('Brace pattern exceeds safe AST bounds');
17
- + }
18
- + if (!node || typeof node !== 'object') continue;
19
- + seen.add(node);
20
- + if (Array.isArray(node.nodes)) {
21
- + for (const child of node.nodes) pending.push([child, depth + 1]);
22
- + }
23
- + }
24
- +};
25
- diff --git a/lib/parse.js b/lib/parse.js
26
- --- a/lib/parse.js
27
- +++ b/lib/parse.js
28
- @@ -144,6 +144,7 @@
29
-
30
- if (value === CHAR_LEFT_PARENTHESES) {
31
- block = push({ type: 'paren', nodes: [] });
32
- + if (stack.length >= 64) throw new SyntaxError('Brace pattern exceeds safe nesting depth');
33
- stack.push(block);
34
- push({ type: 'text', value });
35
- continue;
36
- @@ -210,6 +211,7 @@
37
- };
38
-
39
- block = push(brace);
40
- + if (stack.length >= 64) throw new SyntaxError('Brace pattern exceeds safe nesting depth');
41
- stack.push(block);
42
- push({ type: 'open', value });
43
- continue;
44
- diff --git a/lib/compile.js b/lib/compile.js
45
- --- a/lib/compile.js
46
- +++ b/lib/compile.js
47
- @@ -1,9 +1,12 @@
48
- 'use strict';
49
- +
50
- +const assertDepth = require('./depth-guard');
51
-
52
- const fill = require('fill-range');
53
- const utils = require('./utils');
54
-
55
- const compile = (ast, options = {}) => {
56
- + assertDepth(ast);
57
- const walk = (node, parent = {}) => {
58
- const invalidBlock = utils.isInvalidBrace(parent);
59
- const invalidNode = node.invalid === true && options.escapeInvalid === true;
60
- diff --git a/lib/expand.js b/lib/expand.js
61
- --- a/lib/expand.js
62
- +++ b/lib/expand.js
63
- @@ -1,4 +1,6 @@
64
- 'use strict';
65
- +
66
- +const assertDepth = require('./depth-guard');
67
-
68
- const fill = require('fill-range');
69
- const stringify = require('./stringify');
70
- @@ -31,6 +33,7 @@
71
- };
72
-
73
- const expand = (ast, options = {}) => {
74
- + assertDepth(ast);
75
- const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
76
-
77
- const walk = (node, parent = {}) => {
78
- diff --git a/lib/stringify.js b/lib/stringify.js
79
- --- a/lib/stringify.js
80
- +++ b/lib/stringify.js
81
- @@ -1,8 +1,11 @@
82
- 'use strict';
83
- +
84
- +const assertDepth = require('./depth-guard');
85
-
86
- const utils = require('./utils');
87
-
88
- module.exports = (ast, options = {}) => {
89
- + assertDepth(ast);
90
- const stringify = (node, parent = {}) => {
91
- const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
92
- const invalidNode = node.invalid === true && options.escapeInvalid === true;
@@ -1,20 +0,0 @@
1
- diff --git a/lib/rsa.js b/lib/rsa.js
2
- --- a/lib/rsa.js
3
- +++ b/lib/rsa.js
4
- @@ -1172,7 +1172,15 @@
5
- var capture = {};
6
- var errors = [];
7
- if(!asn1.validate(obj, digestInfoValidator, capture, errors) ||
8
- - obj.value.length !== 2) {
9
- + obj.value.length !== 2 ||
10
- + // Wonderland security backport: AlgorithmIdentifier has one OID
11
- + // and, optionally, exactly one empty primitive NULL parameter.
12
- + obj.value[0].value.length < 1 || obj.value[0].value.length > 2 ||
13
- + (obj.value[0].value.length === 2 &&
14
- + (obj.value[0].value[1].tagClass !== asn1.Class.UNIVERSAL ||
15
- + obj.value[0].value[1].type !== asn1.Type.NULL ||
16
- + obj.value[0].value[1].constructed !== false ||
17
- + obj.value[0].value[1].value !== ''))) {
18
- var error = new Error(
19
- 'ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 ' +
20
- 'DigestInfo value.');
@@ -1,11 +0,0 @@
1
- --- a/dist/index.mjs
2
- +++ b/dist/index.mjs
3
- @@ -2890,6 +2890,7 @@
4
- xe as TaskConfigurationError,
5
- Sn as grepQueryBuilder,
6
- ko as pathspec,
7
- - wo as simpleGit
8
- + wo as simpleGit,
9
- + wo as default
10
- };
11
- //# sourceMappingURL=index.mjs.map