Repository navigation
fix(security): Parse Shimeji XML with defusedxml, move to zip 9, and audit dependencies in CI - #1735
Conversation
Document pillow and defusedxml in a shared requirements file for the importer. Co-authored-by: Cursor <cursoragent@cursor.com>
Keeps resize filters valid on Pillow 10+ without breaking older aliases. Co-authored-by: Cursor <cursoragent@cursor.com>
Covers stderr capture pipes, macOS window activation, and harness SIGKILL paths. Co-authored-by: Cursor <cursoragent@cursor.com>
Refresh the lockfile; document RUSTSEC-2024-0429 until Tauri pulls glib 0.20+. Co-authored-by: Cursor <cursoragent@cursor.com>
Runtime still serves src/vendor/marked.esm.js; devDependency mirrors the pinned version. Co-authored-by: Cursor <cursoragent@cursor.com>
The vendored file is minified; src/markdown.js never feeds user regex patterns. Co-authored-by: Cursor <cursoragent@cursor.com>
Covers Homebrew checksums, updater public keys, and test token field names. Co-authored-by: Cursor <cursoragent@cursor.com>
Bump fidget's zip to 9.0.5; restore main lockfile aside from that line. Document ignored transitive zip/glib and unmaintained advisories in .cargo/audit.toml only. Drop deny.toml, exclude .venv-security from scans and gitignore, refresh baseline. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed the Soft Open at
Expect Linux — Cursor agent, on @omesser's behalf. |
Drop unsupported audit.toml unmaintained section; run cargo audit without --deny warnings. Co-authored-by: Cursor <cursoragent@cursor.com>
Align audit ignores with unmaintained advisories; bump rustls/webpki for audit DB. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Follow-up at
Ready for another look when you have a moment. — Cursor agent, on @omesser's behalf. |
Reset Cargo.lock to main, then bump only fidget's zip 9 and the four rustls/webpki crates cargo-audit needs. Clarify why updater zip 4.6.1 advisories are ignored. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed second Soft Open at
— Cursor agent, on @omesser's behalf. |
- import-pet: defusedxml is the only entity guard; its refusal exits cleanly, and the self-test covers UTF-16, which the byte scan missed. - Pillow: Image.Resampling directly; requirements state pillow>=9.1. - package.rs: drop the cap zip 9 makes unreachable; the zip-bomb test now says it pins zip's own declared-size check. - CI: prebuilt cargo-audit; audit.toml keeps only the ignores that change the exit code. - npm: package name fidget; test ties package.json and the lock to the vendored marked version. - DEVELOPMENT.md: name defusedxml, drop "glance". Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed both Soft+Hard reviews at
The audit-on-every-PR policy question is listed under human follow-ups in the PR body. Checked locally (macOS): — Cursor agent, on @omesser's behalf. |
taiki-e/install-action is not on the repo's Actions allowlist, so PR Tests hit startup_failure. Download cargo-audit v0.22.2 and check its sha256 in a run step instead. The vendored-marked test uses one version constant for the hash message and both pin checks. Co-authored-by: Cursor <cursoragent@cursor.com>
|
CI is green at — Cursor agent, on @omesser's behalf. |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Secret scanning moved to its own workflow,
— Cursor agent, on @omesser's behalf. |
…wlist the whole block. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Oded decided: secret scanning stays in its own — Cursor agent (P. Architect), on @omesser's behalf. |
|
Fixes from the Soft+Hard gate and the Soft Open at
— Cursor agent, on @omesser's behalf. |
…ining them. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Fixes from the Soft+Hard gate at
— Cursor agent, on @omesser's behalf. |
|
|
||
| # Rewrites `.secrets.baseline` when a known hit moves; commit the rewrite. | ||
| # CI runs it in secret-scanning.yml, which fails on new secrets only. | ||
| - repo: https://github.com/Yelp/detect-secrets |
There was a problem hiding this comment.
it's either a lint or isn't. if it's fast enough to be a lint step, don't skip in CI, and remove from secret scanning workflow
There was a problem hiding this comment.
Agreed, it's a lint. Done in 382be4a8. The hook takes about 1.3 s on a typical commit locally and about 30 s for a full-tree scan of 1,219 files. PR Tests' pre-commit step no longer skips it, docs-only runs included. The detect-secrets job is gone from secret-scanning.yml, which now runs only TruffleHog. A stale baseline line number now fails CI like any other fixer hook, instead of the old job's warning.
— Cursor agent, on @omesser's behalf.
…nning keeps only TruffleHog. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Split done, per the Soft+Hard gate at
19 files remain against — Cursor agent, on @omesser's behalf. |
…ps-2026-10 Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # .github/workflows/mattpocock-skills-sync.yml # .github/workflows/pstack-sync.yml # tests/chat-markdown.test.js
omesser
left a comment
There was a problem hiding this comment.
Soft CLEARED
Tip: 4d127e8e
What changed
- Main merged in: brings in secret scanning from #1773 plus eight other main commits; the PR's own changes are untouched.
- Sync workflows resolved:
pstack-sync.ymlandmattpocock-skills-sync.ymlnow dispatch PR Tests, Security and Secret Scanning at the sync branch, and the PR body text names all three. - Docs and test resolved: the Security paragraph moves under its own Dependency Audits heading in
docs/DEVELOPMENT.md, and the marked hash intests/chat-markdown.test.jskeeps its allowlist pragma.
What is wrong
Nothing blocking. Each conflict keeps both sides, and all three dispatched workflows accept workflow_dispatch.
Soft-FIX
None
Verified: read the merge's conflict resolutions, ran the chat-markdown, skills-layout, skills-ownership and scenario-cleanup tests green at this tip, and parsed every workflow.
— Cursor agent (Architect), on @omesser's behalf.
omesser
left a comment
There was a problem hiding this comment.
Soft+Hard — tip 4d127e8e — Not cleared
| Axis | Verdict |
|---|---|
| Soft | Fail |
| Spec | Pass |
| Hard | Pass |
| Total | Not cleared |
The code at this tip is ready. The one fix is a broken sentence in the PR body. Since my gate at 483e9299, the only new commit merges main, which brings in secret scanning from #1773, now merged. I checked how each conflict was resolved. The other-account reviews agree on the code: Soft CLEARED at 4d127e8e and Soft CLEARED at 483e9299. Neither covers the PR body.
Checklist
- Head is
4d127e8e, open, not a draft, mergeable. Its parents are483e9299andmainat6cf630d1(#1773). - No secret scanning in the diff. Against
main, 19 files change, and none of them issecret-scanning.yml,.secrets.baseline,.pre-commit-config.yaml,tests.yml,e2e-macos.yml,src/settings.js, the three settings tests orpre-commit-scans-everything.test.js. The PR adds no allowlist pragma, andtests/chat-markdown.test.js:529's pragma comes unchanged frommain.DEVELOPMENT.md's Secret Scanning section ismain's text. - Nothing lost in the split. Compared with the cleared
e6a36fc7, only files on the move-out list dropped out.security.yml,.cargo/audit.toml,package.jsonand its lock, themarkedpin test, theimport-pet.pydefusedxml change,requirements-import.txt, theImage.Resamplingchanges, zip 9 with itspackage.rschanges, and theSAFETY:comments inacp_wire.rs,platform.rsandprocess_log.rsare all here. TheSAFETY:comments survived #1777's comment trim in the merge. - Merge resolution: both sync workflows dispatch
tests.yml,security.ymlandsecret-scanning.yml. Each dispatch is non-fatal and logs its own::error::. Theiractions: writecomment, step name and PR body text all say "all three". All three workflows acceptworkflow_dispatch. The line insecurity.ymlnamingsecret-scanning.ymlcame back with the merge, and it is accurate now that the file is onmain. -
security.ymlfollows your cargo-audit decision. It readsmax_stable_versionfrom the crates.io API withjqand fails fast on an empty or null answer. It caches~/.cargo/bin/cargo-auditwith the SHA-pinnedactions/cachekeyed on that version and runscargo install cargo-audit --locked --versionon a miss. npm-audit runs--audit-level=highoverpackage-lock.json. The jobs run in parallel to PR Tests. Every action is GitHub's own and pinned to the same SHA used intests.yml, so the allow-list needs nothing. actionlint reports nothing onsecurity.yml. - Tests at this tip:
node --test tests/*.test.jsgives 816 pass and 0 fail.import-pet.py --self-testpasses.cargo test --locked --bins package::passes 31/31 on Linux. - House rules: no sleeps or polls, and no string-then-regex parsing (
jqreads the version). Every new comment is 3 lines or fewer. Harness text is untouched.
Mutation pass
Each mutation was reverted afterwards, and the tree is clean.
| Mutation | Result |
|---|---|
import-pet.py back on xml.etree |
self-test fails |
import-pet.py back on main's guard (xml.etree and the ASCII <!ENTITY scan) |
self-test fails on the UTF-16 pack, so the new test is red without the fix |
package.rs swallowing zip's read error (let _ = entry.read_to_end(..)) |
an_archive_entry_that_inflates_past_what_it_declares_is_refused fails |
package.json marked moved to 18.0.12 alone |
the pin test in chat-markdown.test.js fails |
package.rs ignoring budget.charge(entry.size()) |
survives: all 31 pass. No test covers the budget on either path, and that gap is on main too. See Non-blocking |
CI at 4d127e8e
Every check run is on this head SHA and none is a startup_failure. Security passed: cargo-audit in 3m20s and npm-audit in 10s. PR Tests passed: checks on ubuntu and macos, renderer and windows. Secret Scanning (detect-secrets, trufflehog) from main passed, and so did Pages build, with deploy skipped. cargo-audit 0.22.2 was a cache miss this time and was installed with --locked. The cache entry from 483e9299 was gone, and the new one is saved.
Soft — Fail
- Fix: the PR body's Evidence list stops mid-sentence: "CI: Security (
cargo-audit,npm-audit) and PR Tests". Finish it, for example "…and PR Tests pass at4d127e8e", or drop the bullet.
Spec — Pass
The scope after the split is all here and nothing more: security.yml, its dispatch from the two sync workflows, the marked devDependency and lock with the pin test, the defusedxml hardening of import-pet.py, and the other security-review follow-ups (zip 9, SAFETY: comments, Image.Resampling, the vendor README note). No secret-scanning content remains, and the PR body links #1773.
Hard — Pass
- Importer: defusedxml refuses entity declarations in any encoding. Proven at step 4: the self-test passes, and
main's guard fails it on UTF-16. - Zip: zip 9 refuses an entry that inflates past the size it declares. Proven at step 4: the zip-bomb test passes, and it fails when the read error is swallowed. The budget charge's behaviour is unchanged from
main, and it still returns early with?. - CI blast radius: a new advisory fails Security on every PR until it is bumped or ignored. The PR body's Merge Danger accepts that. The sync dispatches cannot fail their jobs.
Non-blocking
- The surviving mutant above: nothing tests that an archive declaring more than
MAX_PACKAGE_BYTES, or holding more thanMAX_PACKAGE_FILESentries, is refused. The newread_archivecomment relies on that charge ("a zip bomb stops at what was charged"). The gap is onmaintoo, so a follow-up test fits better than a fix here. - The cargo-audit cache saved on a PR ref serves only that PR. Once
security.ymlruns onmain, its cache is shared by every PR. - Carried over:
.gitignore's.venv-security/is a local scratch venv and can stay.
Fix list: finish or drop the CI bullet in the PR body. Oded merges himself.
— Cursor agent (subagent of P. Architect), on @omesser's behalf.
omesser
left a comment
There was a problem hiding this comment.
Soft+Hard — tip 4d127e8 — Cleared
| Axis | Result |
|---|---|
| Spec | Pass |
| Hard | Pass |
| Soft | Pass. The one open item from the previous gate, the cut-off CI bullet under Evidence, is now finished in the PR body (a body-only edit, with no code change since that gate). |
| CI | Green at this tip |
Fix list empty. The other account's Soft CLEARED review at this tip (5619725090) agrees.
A non-blocking gap that is also on main: nothing tests the archive size or file-count limits in package.rs. A follow-up issue is filed for it.
— Cursor agent (P. Architect), on @omesser's behalf.
Summary
Follow-ups from the October security review. Secret scanning already landed in #1773.
Image.Resampling.NEAREST/.LANCZOSinimport-pet.pyandgenerate-readme-gifs.py.scripts/requirements-import.txtpinspillow>=9.1and adds defusedxml.zipand the four TLS patch crates move inCargo.lock. The zip-bomb test now pins zip's own check..cargo/audit.tomlignores only the updater's zip 4.6.1 advisories.package.jsongainsmarked@18.0.13as a devDependency with a lockfile. A test keeps that pin equal to the vendoredsrc/vendor/marked.esm.js, whichsrc/vendor/README.mddocuments along with the ReDoS finding.docs/DEVELOPMENT.mdgets a Dependency Audits section and the importer's new setup line.Evidence
import-pet.py --self-testpasses. Withxml.etreeswapped back in, the UTF-16 entity pack gets through and the self-test fails.cargo test --locked --bins package::passes 30/30 on macOS. It fails if zip stops checking declared sizes.cargo clippy --workspace --all-targets -- -D warningsis clean.node --test tests/chat-markdown.test.jspasses. It fails ifpackage.jsonor the lock moves off the vendored version alone.main's detect-secrets job command passes over the merged tree with no baseline change.cargo-audit,npm-audit) and PR Tests pass at4d127e8e.Risk accepted (no code change)
src/markdown.js).ax-window-linux.py:84"unsubscriptable": guarded by thebest is Noneshort-circuit.Human follow-ups (out of repo)
.envkeys: delete the commented keys and rotate the live ones.Merge Danger
Door: two-way
Blast Radius: CI
A new advisory against any locked crate or npm package now fails Security on every pull request, even one that didn't touch it, until it's bumped or ignored in
.cargo/audit.toml. Character Package import now needs defusedxml, so a stale venv needsuv pip install -r scripts/requirements-import.txt.— Cursor agent, on @omesser's behalf.