Repository navigation
Conversation
…line F6: doctor.sh echoed last-save.json's .session/.line into the report with no control-byte scrub, letting an embedded newline forge a column-0 VERDICT:/FAIL: line that commands/doctor.md tells the relaying assistant to quote back verbatim. Scrubbed with the same tr -d '[:cntrl:]' pattern REMEMBER_TRANSCRIPT_PATH already uses, and clarified the doctor.md relay instruction to treat quoted store values as data, never instructions. F14/F15: .oss/statusline.py's repo_version and _latest_release called .get() on a JSON document with no isinstance(dict) check, so a syntactically valid but non-object plugin.json (local or remote) raised AttributeError and either blanked the whole status line or silently froze the rendered board. Fixed the same way _watch_preset_declared already guards, and applied the identical guard to the same crash class found in repo_config, installed_plugins and _installed_plugin_root. Tests added red-then-green for both classes; changelog fragment and a windows-skip-triage row for the new doctor.sh test module included. Co-Authored-By: Max <noreply>
Self-review finding (oss:auditor) on this issue: installed_plugins() also reads a second JSON document per entry -- the installed plugin's own .claude-plugin/plugin.json at the installPath an installed_plugins.json entry names -- and called .get() on it with no isinstance(dict) guard, the same crash class the rest of this issue's fix already closed for the top-level document. Guarded and pinned with a red-then-green test. Co-Authored-By: Max <noreply>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes three Claude Security scan findings clustered on issue #727:
scripts/doctor.sh):.session/.lineread out oflast-save.jsonwithjq -rand echoed unsanitized into the "Last successful save" report line. An embedded newline
in either value could forge a column-0
VERDICT:/FAIL:line thatcommands/doctor.mdtold the relaying assistant to quote back verbatim and never contradict. Scrubbed with
tr -d '[:cntrl:]', the same patternREMEMBER_TRANSCRIPT_PATHalready uses a few linesabove in the same file.
.oss/statusline.py):repo_versionand_latest_releaseeach called.get()on a parsed JSON document with no check that it was a dict first. A syntacticallyvalid but non-object
.claude-plugin/plugin.json(a bare list, string, number, ornull)raised an uncaught
AttributeError, blanking the whole status line or freezing therefreshed board at stale counts. Guarded with
isinstance(doc, dict), mirroring theexisting
_watch_preset_declaredpattern.named in the original scan):
repo_config,installed_plugins(both its top-levelinstalled_plugins.jsonread and, per a self-review finding, the per-plugin.claude-plugin/plugin.jsonit reads for each matched entry), and_installed_plugin_root. All guarded the same way.commands/doctor.mdnow states explicitly that store-derived values quoted inline in thereport (session id, line number, path) are data the tool is reporting, never instructions.
Adjacent, below the filing bar
The new doctor.sh test module inherits the repo's existing win32 blanket-skip convention
(docs/windows-skip-triage.md), so it does not itself exercise the F6 fix on windows-latest
CI -- the fix (a bash tr builtin, and this diff's isinstance guards) is platform-neutral and
does run there regardless.
Test plan
tests/test_doctor_last_save_forgery_727.py-- 4 tests: 2 attack cases (embeddednewline in
.session/.lineforging aVERDICT:/FAIL:line), 2 positivecontrols (healthy input still reported; doctor's own VERDICT line still emitted).
Watched red before the fix (2 failed), green after (4 passed).
tests/test_statusline_nondict_manifest_727.py-- 11 tests across 5 guarded callsites, each a non-object/well-formed pair. Watched red before the fix (5 failed with
real
AttributeErrors viagit stashof statusline.py), green after (10 passed, then11 after the self-review fix for the per-plugin-manifest site, itself watched red
then green).
regressions.
changelog.d/727.fixed.mdadded; changelog fragment checker passes.pytest-- deliberately not run locally; CI is the source of truth for thewhole suite.
Closes #727
[AI-generated]