Files
bookmarkmagic/scripts/sanitize
poli0981andClaude Opus 5.5 7f306d1271 fix(scripts): serve the harness from a file index, and a linear CSV number test
SonarCloud's quality gate failed PR #27 on two findings in new code.

- S2083 (blocker): the screenshot harness built the file path from the
  request and then checked it stayed inside the build. The check held, but
  taint analysis cannot see a prefix test, so the harness now lists the
  build once and serves only files from that index; a request can name a
  file only by looking it up. It re-lists once on a miss, so a rebuild
  while it runs still works. Probed: valid files 200; `..`, `%2e%2e`,
  `%2F` and `%5C` traversals 404; a malformed escape 400.
- S8786: `^\s*\d*\s*$` in the CSV sanitizer let two `\s*` compete for the
  same blanks. `^\d*$` on the trimmed value means the same and is linear.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 03:22:56 +07:00
..