Skip to content

Commit 424df31

Browse files
authored
[codex] fix scorecard vuln and fuzzing gaps (#16)
* fix: reduce scorecard security and fuzzing debt * test: guard bootstrap pip security floor
1 parent b6fbc34 commit 424df31

5 files changed

Lines changed: 73 additions & 7 deletions

File tree

apps/webui/package-lock.json

Lines changed: 45 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/webui/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@
5050
"eslint": "^9.39.1",
5151
"eslint-plugin-react-hooks": "^7.0.1",
5252
"eslint-plugin-react-refresh": "^0.5.2",
53+
"fast-check": "^4.3.0",
5354
"globals": "^16.5.0",
5455
"jsdom": "^28.1.0",
5556
"postcss": "^8.5.8",
5657
"tailwindcss": "^3.4.19",
5758
"tailwindcss-animate": "^1.0.7",
5859
"typescript": "~5.9.3",
5960
"typescript-eslint": "^8.58.0",
60-
"vite": "^7.3.1",
61+
"vite": "^7.3.2",
6162
"vitest": "^4.1.2"
6263
}
6364
}

apps/webui/src/test/job-status.test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import fc from 'fast-check'
12
import { describe, expect, it } from 'vitest'
23

34
import { normalizeJobStatus } from '@/lib/job-status'
@@ -11,4 +12,19 @@ describe('normalizeJobStatus', () => {
1112
expect(normalizeJobStatus('unknown-status')).toBe('queued')
1213
expect(normalizeJobStatus(undefined)).toBe('queued')
1314
})
15+
16+
it('only preserves the documented status set', () => {
17+
const known = new Set(['queued', 'running', 'cancelling', 'succeeded', 'failed', 'cancelled'])
18+
19+
fc.assert(
20+
fc.property(fc.string(), (candidate) => {
21+
const normalized = normalizeJobStatus(candidate)
22+
if (known.has(candidate)) {
23+
expect(normalized).toBe(candidate)
24+
} else {
25+
expect(normalized).toBe('queued')
26+
}
27+
}),
28+
)
29+
})
1430
})

tests/unit/test_frontend_gate_bootstrap.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,13 @@ def test_bootstrap_env_prebuilt_restore_clears_existing_runtime_venv_contents()
202202
assert 'python3 -m venv "$target"' in script
203203

204204

205+
def test_requirements_pip_lock_keeps_pip_at_or_above_the_current_security_floor() -> None:
206+
lock = (_repo_root() / "tooling" / "requirements-pip.lock.txt").read_text(encoding="utf-8")
207+
208+
assert "pip==26.0.1" in lock
209+
assert "pip==25.0.1" not in lock
210+
211+
205212
def test_restore_prebuilt_tree_replaces_existing_contents_without_file_exists_conflicts(tmp_path: Path) -> None:
206213
script = _repo_root() / "tooling" / "scripts" / "restore_prebuilt_tree.py"
207214
src = tmp_path / "src"

tooling/requirements-pip.lock.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
pip==25.0.1 \
2-
--hash=sha256:c46efd13b6aa8279f33f2864459c8ce587ea6a1a59ee20de055868d8f7688f7f
1+
pip==26.0.1 \
2+
--hash=sha256:bdb1b08f4274833d62c1aa29e20907365a2ceb950410df15fc9521bad440122b \
3+
--hash=sha256:c4037d8a277c89b320abe636d59f91e6d0922d08a05b60e85e53b296613346d8

0 commit comments

Comments
 (0)