Commit Graph
5 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5.5 8519e7c39e fix(qodana): act on the first run, and read the report where it really is
The first scan found 27 issues and no defect:
- two regular expressions that could be simpler, fixed: the sanitizer's
  [\p{Extended_Pictographic}] class and wxt.config.ts's split(/[/]/). A third
  is in src/ and waits for the 1.3.0 change, so this branch still builds
  byte-for-byte what v1.2.1 shipped;
- 24 that contradict a rule of this repository, switched off in
  qodana.yaml with the reason beside each: JSDoc completeness (doc comments
  here are prose, docs/10 §6), bitwise operators in the PNG CRC-32 of
  gen-icons.mjs, and the deliberately doubled dark palette in tokens.css.

`publish` failed: the qodana-report artifact holds a zip whose entries have
absolute names, so a glob for the SARIF found nothing. It now extracts the
one entry /qodana.sarif.json by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 21:03:47 +07:00
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
poli0981andClaude Opus 5.5 434c05b85f fix(review): credit everything the build compiles in, close three sanitizer leaks, sync the spec
From the v1.1.0 adversarial review (security) and the docs pass:

- clsx (MIT) ships too — the Svelte runtime imports it — and wxt's browser
  module as well as @wxt-dev/browser. All four are now credited in About,
  PRIVACY, README and both notice files, and wxt.config.ts fails the build when
  code from any uncredited package would ship; tests/unit/third-party.test.ts
  keeps the notices in step with that list.
- Sanitizer, CSV: default-deny. A title with an unquoted comma — the row that
  makes the extension report CSV_ROW_MISMATCH — shifted a file: path and free
  text into columns no rule rewrote, and the host-only check passed them.
- Sanitizer, HTML: unknown attributes (Firefox POST_DATA, any DATA-*) are
  rewritten; only dates, root markers and the charset line are kept.
- Sanitizer: a value-level leak check over CSV fields, attribute values and
  JSON strings, and a refusal that prints counts only — it used to print the
  leaked words and ask for them in a public issue.
- BM_ENV_ERROR_CODES joins the per-locale message check, with the four fixed
  keys describeError maps; the popup no longer logs crashes nothing can read.
- docs 00/02/03/05/06/07/08/09/11/13 describe v1.1.0 (diagnostics moved to
  09 §7; 13 §3 points at store/listing.* instead of a drifting copy); tokens
  and gen-icons comments corrected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 03:22:56 +07:00
poli0981andClaude Opus 5.5 1bd6aca93c fix(security): clear SonarCloud's findings on the new gates, and close remote stylesheets
The first CI-based SonarCloud scan failed the quality gate on its new-code
security rating, with two findings in check-manifest.mjs:
- S8707: it read whatever directory the CLI argument named. It now accepts
  only paths inside this repository or the OS temp directory (where its
  tests build fake extensions), and says so when it refuses.
- S8689: its success line echoed values read from the file. It now prints
  constants — the manifest has just been proven equal to them.

And four S8786 regexes in guard.mjs plus one in the sanitizer, where a \s*
beside an optional quote beside another \s* could backtrack: each is now
written so no two quantifiers compete for the same characters, and the
markup rule is two linear steps (find the tag, then look inside it). The
sanitizer's JSON tokenizer no longer reassigns its loop counter (S2310).

While here: with no default-src, style-src was open, so a remote stylesheet
could still load. The CSP now adds `style-src 'self' 'unsafe-inline'`
(Svelte sets style attributes); check-manifest pins the new string.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:06:52 +07:00
poli0981andClaude Opus 5.5 0671bb3c33 fix(scripts): the sanitizer stops leaking Chrome profile titles, and every script is checked
sanitize-bookmarks.mjs accepted any JSON object and rewrote only "url" and
"title". Chrome's profile Bookmarks file keeps titles under "name" (plus
meta_info and a base64 sync_metadata blob), so it came out with every title
intact, passed the host-only leak check, and was written as "sanitized" —
the exact file a reporter whose import failed would attach.

- JSON dialects are recognised by shape (BookmarkMagic, Chrome profile,
  Firefox backup); any other JSON is refused. Rewriting is default-deny: a
  small tokenizer tracks the key of every string value and replaces all of
  them except structural keys (types, ids, timestamps, root GUIDs), by span,
  so layout and key order stay byte-identical.
- The backstop now reads the output's TEXT: for HTML it strips markup and
  refuses on any word that is not a placeholder — independent of the
  rewriting rules, unlike the old host-only check whose test shared its
  blind spots. <DD class=…> notes, file: ICON_URIs and <H1>/<TITLE>
  owner names are rewritten.
- Attribute values decode in one pass (CodeQL js/double-escaping), <DD>
  bodies are found in linear time (Sonar S8786), the input is never
  overwritten, size is checked before reading, and bytes are bytes.
- The 627-line file is split into scripts/sanitize/ modules; the
  user-facing entry stays plain .mjs for reporters on any Node.

gen-fixture.mjs validates its flags (whole numbers >= 1, values required, no
unknown flags) and its loop visibly advances (Sonar S2189 blocker).
gen-icons.mjs says what is true: it is the icons' source of truth.

Every script now carries // @ts-check and tsconfig.scripts.json runs them
through the TS 7 tsc in `npm run check`; docs/10's size rule names .mjs.
Regenerated icons are byte-identical.

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