~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
fix(deps): remove infrastructure sprintf-js dependency (#7223)
LearningCircuitb134863cfa19
diff --git a/.github/workflows/npm-audit.yml b/.github/workflows/npm-audit.ymlindex 14043c3dea..3c6a10478d 100644--- a/.github/workflows/npm-audit.yml+++ b/.github/workflows/npm-audit.yml@@ -29,14 +29,6 @@ jobs:node-version: '24'- name: Run npm audit on all package.json locations- env:- # Advisories with NO upstream fix, accepted ONLY because they live in- # dev/test-only tooling that never ships to users. Keep tight + justified:- # GHSA-h67p-54hq-rp68 — js-yaml 3.x DoS, pulled transitively by- # @lhci/utils (accessibility_tests) & @istanbuljs/load-nyc-config- # (infrastructure_tests); both pin js-yaml ^3, no patched 3.x exists.- # Dev-only, parses trusted local config. (dismissed alerts #97/#7893)- AUDIT_ALLOWLIST: "GHSA-h67p-54hq-rp68"run: |FAILED=falseFILTER="${GITHUB_WORKSPACE}/.github/scripts/npm_audit_allowlist.py"diff --git a/changelog.d/+infrastructure-sprintf.security.md b/changelog.d/+infrastructure-sprintf.security.mdnew file mode 100644index 0000000000..b68633e948--- /dev/null+++ b/changelog.d/+infrastructure-sprintf.security.md@@ -0,0 +1 @@+Remove the vulnerable sprintf-js dependency from the infrastructure test toolchain by upgrading its YAML parser to js-yaml 4, and retire the obsolete npm audit exception for older YAML parser versions.diff --git a/tests/infrastructure_tests/package-lock.json b/tests/infrastructure_tests/package-lock.jsonindex f148961e65..69e68d4364 100644--- a/tests/infrastructure_tests/package-lock.json+++ b/tests/infrastructure_tests/package-lock.json@@ -2006,14 +2006,11 @@}},"node_modules/argparse": {- "version": "1.0.10",- "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",- "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==","dev": true,- "license": "MIT",- "dependencies": {- "sprintf-js": "~1.0.2"- }+ "license": "Python-2.0"},"node_modules/babel-jest": {"version": "30.5.2",@@ -2494,20 +2491,6 @@"node": ">=8"}},- "node_modules/esprima": {- "version": "4.0.1",- "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",- "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",- "dev": true,- "license": "BSD-2-Clause",- "bin": {- "esparse": "bin/esparse.js",- "esvalidate": "bin/esvalidate.js"- },- "engines": {- "node": ">=4"- }- },"node_modules/execa": {"version": "5.1.1","resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",@@ -3517,14 +3500,23 @@"license": "MIT"},"node_modules/js-yaml": {- "version": "3.15.2",- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.2.tgz",- "integrity": "sha512-6EuL879VkRA+1Cz578mKMiKvjPNEuk6+r1JaFzoSWejZmtf7xWbIyw1e3KkxlkzTIt9Taw6JBhEppG7utc1P+w==",+ "version": "4.3.2",+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz",+ "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==","dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/puzrin"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/nodeca"+ }+ ],"license": "MIT","dependencies": {- "argparse": "^1.0.7",- "esprima": "^4.0.0"+ "argparse": "^2.0.1"},"bin": {"js-yaml": "bin/js-yaml.js"@@ -4068,13 +4060,6 @@"node": ">=8"}},- "node_modules/sprintf-js": {- "version": "1.0.3",- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",- "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",- "dev": true,- "license": "BSD-3-Clause"- },"node_modules/stack-utils": {"version": "2.0.6","resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz",diff --git a/tests/infrastructure_tests/package.json b/tests/infrastructure_tests/package.jsonindex a4c9deaab2..523360d059 100644--- a/tests/infrastructure_tests/package.json+++ b/tests/infrastructure_tests/package.json@@ -10,7 +10,7 @@"overrides": {"minimatch": ">=10.2.1","@babel/core": "^7.29.7",- "js-yaml": "^3.15.0"+ "js-yaml": "^4.3.2"},"devDependencies": {"@types/jest": "^30.0.0",diff --git a/tests/infrastructure_tests/test_yaml_toolchain.test.js b/tests/infrastructure_tests/test_yaml_toolchain.test.jsnew file mode 100644index 0000000000..961b0e282f--- /dev/null+++ b/tests/infrastructure_tests/test_yaml_toolchain.test.js@@ -0,0 +1,74 @@+const fs = require('node:fs');+const os = require('node:os');+const path = require('node:path');+const { execFileSync } = require('node:child_process');+const { loadNycConfig } = require('@istanbuljs/load-nyc-config');++// The security override crosses load-nyc-config's declared js-yaml major.+// Exercise its real YAML loader and CLI rather than just checking the lockfile.+describe('coverage YAML toolchain compatibility', () => {+ let directory;++ beforeEach(() => {+ directory = fs.mkdtempSync(path.join(os.tmpdir(), 'ldr-nyc-yaml-'));+ fs.writeFileSync(path.join(directory, 'package.json'), '{}');+ });++ afterEach(() => {+ fs.rmSync(directory, { recursive: true, force: true });+ });++ test('loads inherited YAML coverage settings with their types intact', async () => {+ fs.writeFileSync(path.join(directory, 'base.yml'), [+ 'all: true',+ 'exclude:',+ ' - "fixtures/**"',+ 'watermarks:',+ ' lines: [80, 95]',+ ].join('\n'));+ fs.writeFileSync(path.join(directory, '.nycrc.yml'), [+ 'extends: ./base.yml',+ 'include:',+ ' - "src/**/*.js"',+ 'extension: .js',+ 'check-coverage: true',+ 'lines: 87.5',+ ].join('\n'));++ const config = await loadNycConfig({ cwd: directory });++ expect(config).toMatchObject({+ cwd: directory,+ all: true,+ exclude: ['fixtures/**'],+ include: ['src/**/*.js'],+ extension: ['.js'],+ checkCoverage: true,+ lines: 87.5,+ watermarks: { lines: [80, 95] },+ });+ });++ test('keeps the YAML CLI version and conversion commands working', () => {+ const manifestPath = require.resolve('js-yaml/package.json');+ const manifest = require(manifestPath);+ const cli = path.join(path.dirname(manifestPath), manifest.bin['js-yaml']);+ const version = execFileSync(process.execPath, [cli, '--version'], {+ encoding: 'utf8',+ timeout: 5000,+ });+ expect(version.trim()).toBe(manifest.version);++ const yamlPath = path.join(directory, 'config.yml');+ fs.writeFileSync(yamlPath, 'enabled: true\ninclude: [src]\nlines: 87.5\n');+ const converted = execFileSync(process.execPath, [cli, yamlPath], {+ encoding: 'utf8',+ timeout: 5000,+ });+ expect(JSON.parse(converted)).toEqual({+ enabled: true,+ include: ['src'],+ lines: 87.5,+ });+ });+});