Compare commits

...

3 commits

Author SHA1 Message Date
Grovy311
9974948b54 fix(deps): npm audit fix 2026-10-28 (nur Lockfile)
Some checks failed
security-baseline / secrets (push) Has been cancelled
security-baseline / node (push) Has been cancelled
security-baseline / semgrep (push) Has been cancelled
security-baseline / trivy (push) Has been cancelled
npm audit --audit-level=high war im prepush nach dem Baseline-Rollout rot.
npm audit fix ohne --force, package.json unverändert. Geändert:
- body-parser 2.3.0->2.4.0
- iconv-lite 0.7.2->0.7.3
- zod 4.4.1->4.6.7

Moderat offen (Fix nur per --force bzw. Major): esbuild uuid

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 06:38:09 +01:00
Grovy311
e39de4ddf5 chore(security): Baseline-Update 2026-10-27 (mutation_check, Testvorlage)
Aus cj/security-baseline 3a23c7a übernommen:
- scripts/security/mutation_check.py: Syntax-/Importfehler aus einer Mutation zählen nicht
  mehr als getötet ([UNGÜLTIG]); getötet nur bei echtem Testfehler (pytest, unittest,
  node:test spec und TAP), TODO-/SKIP-Tests sind kein Beleg.
- Sicherheitstest-Vorlage: ungültige Eingaben müssen konfiguriert sein (Leerlauf-Sperre).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:19:42 +01:00
Grovy311
02637c1f32 chore(security): Baseline-Update 2026-10-27 (mutation_check, Testvorlage)
Aus cj/security-baseline a04c20b übernommen:
- scripts/security/mutation_check.py: Syntax-/Importfehler aus einer Mutation zählen nicht
  mehr als getötet ([UNGÜLTIG]); getötet nur bei echtem Testfehler (pytest, unittest,
  node:test spec und TAP), TODO-/SKIP-Tests sind kein Beleg.
- Sicherheitstest-Vorlage: ungültige Eingaben müssen konfiguriert sein (Leerlauf-Sperre).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 22:04:48 +01:00
4 changed files with 96 additions and 22 deletions

View file

@ -818,6 +818,8 @@ Open security points (state at adoption, 2026-10-15; updated 2026-10-17):
`project-state-snapshot.model.ts`, `Sidebar.tsx`, `cable-sizing-modal.tsx`,
`estimate-balance-format.ts`, `room-area.ts` – check for ReDoS when inputs can be long;
several `react-hooks/exhaustive-deps` warnings in the editor.
- Baseline-Stand 2026-10-27 (security-baseline 3a23c7a): `mutation_check.py` zählt Syntax-/Importfehler nicht mehr als getötet (`[UNGÜLTIG]`), Sicherheitstests verlangen konfigurierte ungültige Eingaben (Leerlauf-Sperre).
- Abhängigkeiten 2026-10-28: `npm audit fix` ohne `--force` (nur Lockfile) gegen die High-Funde: body-parser: 2.3.0->2.4.0, iconv-lite: 0.7.2->0.7.3, zod: 4.4.1->4.6.7. Moderat offen (Fix nur per `--force`/Major): esbuild uuid .
## Response Style for Codex

26
package-lock.json generated
View file

@ -3009,18 +3009,18 @@
"license": "MIT"
},
"node_modules/body-parser": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
"integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==",
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.4.0.tgz",
"integrity": "sha512-Ifk1KcLrxaGt1occQagQNFNNOqRt1LFuehEnHHzB8Z6cRgIxRU1TBaiIsUiCdA+gy5PL7Y1IX31DNKkRmxtXjQ==",
"license": "MIT",
"dependencies": {
"bytes": "^3.1.2",
"content-type": "^2.0.0",
"content-type": "^2.1.0",
"debug": "^4.4.3",
"http-errors": "^2.0.1",
"iconv-lite": "^0.7.2",
"iconv-lite": "^0.7.3",
"on-finished": "^2.4.1",
"qs": "^6.15.2",
"qs": "^6.16.1",
"raw-body": "^3.0.2",
"type-is": "^2.1.0"
},
@ -4938,9 +4938,10 @@
}
},
"node_modules/iconv-lite": {
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz",
"integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==",
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz",
"integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==",
"license": "MIT",
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
},
@ -8480,9 +8481,10 @@
}
},
"node_modules/zod": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/zod/-/zod-4.4.1.tgz",
"integrity": "sha512-a6ENMBBGZBsnlSebQ/eKCguSBeGKSf4O7BPnqVPmYGtpBYI7VSqoVqw+QcB7kPRjbqPwhYTpFbVj/RqNz/CT0Q==",
"version": "4.6.7",
"resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz",
"integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}

View file

@ -5,6 +5,10 @@ Baut gezielt je eine Schutzfunktion aus (Textersetzung), lässt die Tests laufen
erwartet ROT. Danach wird die Datei immer wiederhergestellt. Überlebt eine Mutation
(Tests bleiben grün), prüfen die Tests diese Schutzfunktion nicht wirklich.
Getötet ist eine Mutation nur, wenn ein Test fehlschlägt (pytest FAILED, unittest
FAIL, node:test ✖ bzw. TAP "not ok") und im Fehlerbericht kein Ladefehler steht
(Syntax-/Importfehler, siehe LOAD_ERRORS). Rot durch kaputten Code zählt als UNGÜLTIG.
Aufruf: mutation_check.py <mutations.toml>
Exit: 0 = jede Mutation hat mindestens einen Test rot gemacht, 1 = sonst
@ -23,6 +27,7 @@ Format (Pfade relativ zur TOML-Datei):
from __future__ import annotations
import os
import re
import subprocess # nosec B404 - Tests starten ist der Zweck des Skripts
import sys
import tomllib
@ -53,16 +58,70 @@ def _write(target: Path, text: str) -> None:
pyc.unlink(missing_ok=True)
def _failed_lines(stdout: str) -> list[str]:
# pytest: "FAILED ...", node:test: "✖ <Testname>" (ohne Suiten und Zusammenfassung)
# "not ok ... # TODO|SKIP": erwartet scheiternder Test (z. B. idorGap), Lauf bleibt grün
TAP_DIRECTIVE = re.compile(r"#\s*(TODO|SKIP)\b")
def _tap_fail(stripped: str) -> bool:
return stripped.startswith("not ok ") and not TAP_DIRECTIVE.search(stripped)
def _failed_lines(output: str) -> list[str]:
# pytest: "FAILED ...", unittest: "FAIL: ...", node:test: "✖ <Testname>" ohne
# Zusammenfassung bzw. TAP (ältere Node-Versionen, `tsx --test` ohne Terminal):
# "not ok <n> - <Testname>"
lines = []
for line in stdout.splitlines():
node_fail = line.startswith(" ✖") and "failing tests" not in line
if line.startswith("FAILED") or node_fail:
lines.append(line.strip())
for line in output.splitlines():
stripped = line.strip()
node_fail = stripped.startswith("✖") and "failing tests" not in line
node_fail = node_fail or _tap_fail(stripped)
# "FAILED (errors=1)" ist die Zusammenfassung von unittest, kein Testfehler.
pytest_fail = line.startswith("FAILED ") and not line.startswith("FAILED (")
if pytest_fail or line.startswith("FAIL:") or node_fail:
lines.append(stripped)
return lines
# Rot durch kaputten Code ist kein Testbeleg (2026-10-27): pytest meldet einen
# Ladefehler als ERROR ohne FAILED, node:test bricht alle Tests ab und markiert sie
# trotzdem mit ✖.
LOAD_ERRORS = (
"SyntaxError",
"IndentationError",
"TabError",
"ImportError",
"ModuleNotFoundError",
"error during collection",
"TransformError",
"ERR_MODULE_NOT_FOUND",
"Cannot find module",
"Cannot find package",
)
def _load_error(text: str) -> str | None:
return next((marker for marker in LOAD_ERRORS if marker in text), None)
def _failure_report(output: str, failed: list[str]) -> str:
# Nur der Fehlerbericht, nicht der ganze Lauf: Logs der App sind kein Ladefehler
# (Selftest 2026-10-27: Express loggt den JSON-SyntaxError von body-parser beim
# Test mit "{kaputt"). node:test: Abschnitt "✖ failing tests:", TAP: die YAML-Blöcke
# unter "not ok" (App-Logs stehen als "# ..." außerhalb), pytest/unittest: die
# Fehlerzeilen selbst.
_, sep, tail = output.partition("✖ failing tests:")
if sep:
return tail
tap, in_block = [], False
for line in output.splitlines():
if _tap_fail(line.strip()):
in_block = True
if in_block:
tap.append(line)
in_block = line.strip() != "..."
return "\n".join(tap) if tap else "\n".join(failed)
def run(config_path: Path) -> int:
base = config_path.parent
config = tomllib.loads(config_path.read_text(encoding="utf-8"))
@ -95,14 +154,24 @@ def run(config_path: Path) -> int:
result = _run_tests(test_cmd, workdir)
finally:
_write(target, original)
output = result.stdout + result.stderr # unittest schreibt auf stderr
failed = _failed_lines(output)
load_error = _load_error(_failure_report(output, failed))
if result.returncode == 0:
print(f"[ÜBERLEBT] {name}: Tests bleiben grün")
survivors.append(name)
elif load_error or not failed:
# Ohne Fehlerzeile (pytest: nur ERROR beim Sammeln): Grund aus ganzem Lauf
load_error = load_error or _load_error(output)
why = "kein Testfehler erkennbar"
if load_error:
why = f"Ladefehler ({load_error})"
print(f"[UNGÜLTIG] {name}: Tests rot, aber {why}, kein Testbeleg.")
print(" Mutation so ändern, dass der Code lauffähig bleibt:")
print(output[-800:])
survivors.append(name)
else:
failed = _failed_lines(result.stdout)
hint = "Tests rot, Ursache prüfen (Syntaxfehler?):\n"
reason = failed[0] if failed else hint + result.stdout[-800:]
print(f"[GETÖTET] {name}: {reason}")
print(f"[GETÖTET] {name}: {failed[0]}")
print(f"\n{len(mutations) - len(survivors)}/{len(mutations)} Mutationen erkannt.")
return 1 if survivors else 0

View file

@ -132,6 +132,7 @@ describe("Eingaben", () => {
});
it("ungültige Eingaben führen nie zu 5xx", async () => {
assert.ok(config.invalidInputCases.length > 0, "invalidInputCases konfigurieren");
const obj = await config.createOwnedObject(baseUrl, owner);
const failures: string[] = [];
for (const c of config.invalidInputCases) {