Repository navigation
fix(dashmate): doctor report redaction follow-ups - #6325
Conversation
The doctor report already leaves a container's health check command out of its inspect sample. What the check printed, in State.Health.Log[].Output, was still archived. It is now replaced with the same marker as the command. The health status, the failing streak, and each check's start and end times and exit code stay. No analyser reads the output. Test: a health log whose output carries a value the config does not know is archived without it, and its status, streak, times and exit code are read back unchanged. ✖ before the fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r report The doctor report keeps a renewal record's provider and failure code as they are, because doctor decides on them. The record file can be edited by hand, so a provider or code dashmate does not know can be any text, and it was copied into the report verbatim. RenewalRecord now has a diagnostic copy, toDiagnosticObject(), which the report collects. A provider outside the SSL providers becomes `unknown` and a code outside the renewal failure codes becomes `UNKNOWN`. The diagnosis does not change: an unfamiliar provider never matches the configured one, and every code check compares with a known code, so an unfamiliar code already read as UNKNOWN. Reading the record from disk stays as tolerant as before. Test: a hand-edited record with an unfamiliar provider and code is collected and archived with the two labels, still reads as a failed renewal live and from the archive, and is still read from disk as written. ✖ before the fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t cannot be moved Before removing a staging directory an earlier version left behind, the report command moves it into a fresh holding directory beside it. When that first move failed, for example because the directory had gone in the meantime, the empty `.dashmate-report-removal-*` directory was left behind. It is now removed, without recursing, and the error of the move is the one reported. Test: with the move failing, the directory is reported with the move's own error and nothing but the original directory is left in the temp directory. ✖ before the fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Before removing a staging directory an earlier version left behind, the report command moves it into a fresh holding directory and checks it again there. A directory that failed that check was renamed back to its old path. Node.js has no portable rename that refuses to replace its target, so the rename could replace whatever had been put at that path in the meantime. A directory that fails the check is now left in the holding directory, which only the user can reach, and the error gives its path. The command reports it as closed to other users. Test: when what was moved is not the directory that was found, it stays in a private `.dashmate-report-removal-*` directory, nothing is put at the old path, and the error names where it is. ✖ before the fix (it was renamed back), ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…left The report command removes a staging directory an earlier version left behind by moving it into a `.dashmate-report-removal-*` directory first. If the command stopped after the move and before the removal, or left a directory there because it failed its last check, a later run did not mention it: discovery only looked at `dashmate-report-<time>` names. Discovery now also lists the user's own holding directories in the temp directory, and the report prints each one as left by a removal that did not finish, for the operator to check and remove. They are never removed or changed automatically: what they hold by then is not known. They are printed even when nothing else is found. Tests: a holding directory with a staging tree in it is listed as a recovery item, a link or a file under that prefix is not, and nothing is removed or re-permissioned; the report task prints it instead of skipping with "Nothing found". ✖ before the fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The report command finds the staging directories earlier versions left, records each one's device and inode, asks the operator, and only removes a directory that still has that identity. Discovery closed the directory before asking. A directory deleted in the meantime gives up its inode, and a new directory put at the same path can be given the same number. Discovery now keeps the handle it checked each found directory through open, after checking the handle is the directory it looked at, until the directory is removed or let go of. An open directory keeps its inode even once deleted, so no other directory can be given its identity while the operator is asked. Removal lets go of each directory when done with it, and the new releaseLegacyReportStagingDirs() does so when the operator declines or cannot be asked. Each is let go of once, so a handle number handed out again is never closed by mistake. Test: the inode reuse itself cannot be forced in a test, so the tests pin the mechanism: each found directory is held through the one handle it was checked through, with its identity; removal and release close it exactly once; and the report task lets go of what it found when the operator says no or the prompt fails. ✖ before the fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e doctor report The doctor report masks every copy of a config secret it finds in the collected samples, URL credentials included, as written and decoded. A percent-escape stands for the same character whatever the case of its hex digits, so `%2f` and `%2F` are the same credential, but the search was exact: a credential written with one case in the config and quoted with the other in a log was not masked. Each secret is now also searched for with all of its escapes in upper case and with all of them in lower case, the two spellings encoders write. A text that mixes the two cases inside one credential is still only matched as the config writes it. Test: a credential written with lower-case escapes in the config is masked in a log that writes them upper-case, and the other way round, while an unrelated escape in the same line is left alone. ✖ before the fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The doctor report's copy of the config hides secret fields one by one and keeps every other value as written, because doctor validates the copy when it reads a report back and a secret can be spelled like a value the schema needs. A secret the operator had repeated in free text, the node description or the Let's Encrypt contact address, was therefore copied as it was. obfuscateConfig() now takes an optional scrubber for those free-text fields only, applied before the operator's identity is masked, and the report passes the one it scrubs every other sample with. No other config value is changed by it. Test: a password repeated in the description and in the contact address is masked in both in the archived config, and nowhere in the archive in full. ✖ before the fix, ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ecret scrub The doctor report scrubs config secrets from its samples as it collects them and again when it writes the archive. Live doctor analyses the collected samples and `doctor -s` the archived ones, and some sample values are facts they decide on. A secret spelled like one of those facts, or containing part of one, changed the diagnosis. The renewal record already has a field policy for this. It now covers the other certificate samples too: - gateway.ssl: the error code the SSL check reports is kept. The archive masked it, so an archived report lost the problem it names. Its `data`, which is display text, is scrubbed as before. - gateway.installedCertificate: the status, reason codes, skipped checks, provider, dates and fingerprint are kept, both when collected and in the archive. The messages are still scrubbed and have the operator's identity masked. - gateway.servedCertificate: the state, failure codes, dates and fingerprints are kept in the archive. Doctor compares these fingerprints with the installed certificate's. The subject, issuer, alternative names, serial number and identity error are still scrubbed. A listed field is now free text with everything in it. The archive writer follows that through nested values, so all of the SSL check's `data` is scrubbed. Tests, each ✖ before the fix and ✔ after: - With a password spelled like the SSL error code, the code and the problem doctor reports are the same live and from the archive, and the code in a data path is masked. - With passwords spelled like the installed certificate's status and a warning code, and one equal to its fingerprint, its facts are kept live and archived and its message is masked. - With a password spelled like the reason code IP_MISMATCH, the repair still forces a new certificate live and from the archive. - With a password that is part of the certificate's fingerprint, the installed, served and on-disk fingerprints are kept live and archived, and a password equal to its serial number is masked in the archive. - In the archive writer, everything nested in a free-text field is scrubbed and the sample's facts are kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…re kept The guide and the confirmation prompt said that copies of the config's secrets are masked anywhere in the archive once they are 8 characters or longer. They are masked in the text the archive carries. The values doctor decides on when it analyses a report are kept as they are, so a secret spelled like one of them is not masked there. The guide now lists those values: other values in the copy of the config, the SSL check's error code, the installed and served certificates' status, codes, dates and fingerprints, and the last renewal's provider, outcome, code and times. It also says that an unrecognised renewal provider is replaced with `unknown` and an unrecognised code with `UNKNOWN`. Both still tell the operator to review the archive before sharing it, and now name a secret spelled like a kept value among the things that can remain. The guide also covers the other changes in this series: health check output is left out, secrets repeated in the node description and contact addresses are masked, and the legacy cleanup lists a holding directory left by a removal that did not finish. No behaviour change; no test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
✅ Final review complete — no blockers (commit af2ab5f) |
…or report scrub The archive writer scrubs every string of Core's and Tenderdash's answers of config secrets. Doctor decides on some of them when it reads a report back. It reads the masternode's state to report a PoSe ban, and it compares the node ID registered for the masternode with the ID derived from the node key, with the saved ID and with the ID Tenderdash runs with. A secret spelled like the state, or like part of the registered ID, changed those verdicts after export: a ban went unreported, or IDs that match were reported as a mismatch. These answers are not dashmate's to list field by field, so they get the opposite policy to the certificate samples: every string is still scrubbed except the facts named by their path. Those facts are masternodeStatus.state and dmnState.platformNodeID, the node ID derived from the key, and the node ID in Tenderdash's status. Node IDs are public, because Tenderdash announces its own to every peer. The guide lists them among the values the report keeps. Test, for a config with only a saved node ID and one with a node key, with passwords spelled like POSE_BANNED and like part of the registered ID: the ban is reported, and no node ID mismatch is, both live and from the archive; the masternode's status text is still masked. ✖ before the fix (the archive lost the ban), ✔ after. Dropping any one of the kept paths fails it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… when they cannot be removed When packing the report fails, the samples staged for it are removed, and the packing error is the one reported. If removing them failed too, that was dropped silently. The samples stayed in a private temp directory under a random name that no later run looks for, and the operator was not told. Removing them after a report was saved could fail as well, and then the command reported only the removal error, without saying the report had been saved or where. - After a failure, the error that stopped the archive still comes first, as the same error with the same code. Its message now also says that the staged samples could not be removed, why, and which directory to remove. An error that cannot be changed is wrapped in a new one, with its code and itself as the cause. When the staged samples are removed, the failure is rethrown exactly as it was. - After a report is saved, a failed removal is reported with both the report's path and the directory to remove. - `doctor report` now wraps its output at the terminal's width instead of cutting it, so these paths are shown in full. Tests, each ✖ before the fix and ✔ after: - The double-failure test checks that the packing error comes first with its code, and names the staging directory and the removal error. - A removal that throws something other than an error is still reported with the packing error. - A failure that is not an Error is rethrown as it is when the staged samples can be removed. - A failed removal after the report is saved names both paths, and the report is still there. The renderer option has no unit test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…es on every platform The test for a staged listing that cannot be read injects its failure for a staging directory under the test's root, and relied on TMPDIR to make the writer stage there. Node on Windows takes the temp directory from TEMP or TMP instead, so the writer staged elsewhere, archiving succeeded and the test failed. The test now stubs os.tmpdir() to the test's root, so the writer and the injected failure agree everywhere. Test-only change. Shown with the writer staging outside the test's root (TMPDIR pointed elsewhere, as Windows would ignore it): ✖ before, since archiving succeeds; ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…or report archive The archive writer lists the staged samples, opens the partial archive file, and hands both to tar. Tar refuses an empty list synchronously, before pipeline() takes over the file. If the staged samples had all been removed in the meantime, for example by a temp cleaner, the partial file was removed but its descriptor stayed open until the process exited. The same held for any other failure between opening the file and packing it, such as the write stream failing to be created. An empty listing is now refused before the partial file is opened, and the staging directory is removed as for any other failure. A failure after the open closes the file before removing it: the raw descriptor if no stream was made, otherwise the stream, waiting until it closes. Tests, each ✖ before the fix and ✔ after: - Next to the listing-error case: with the staged listing coming back empty, no partial archive is opened, nothing is left in the output directory, and the staging directory is gone (before the fix: tar's "no paths specified" after the open). - When the write stream cannot be created, the partial file's descriptor is closed and the file removed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
1 similar comment
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Changes requested: 1 blocker
- A private build URL copied into the node description can retain its access token —
packages/dashmate/src/config/obfuscateConfig.js:310-326(new)
Impact: An operator who copies a build URL containing both userinfo and a signed query token into the node description can disclose the token when sharing a doctor report.
This PR updates Dashmate doctor reports to preserve diagnostic facts, scrub repeated config secrets, omit Docker health-check output, and improve archive and legacy staging cleanup. At 0ca1399, no checks showed a failure; PR Hygiene and PastaClaw review were pending, and the check list did not include a Dashmate unit-test run. The review was static.
🔴 1 blocking | 🟡 7 suggestion(s)
2 finding(s) not shown inline (the lines are not part of this PR's diff)
🟡 Suggestion: Legacy cleanup still accepts a candidate after its discovery handle is released
Impact: A caller that retries with a released candidate can remove a qualifying replacement directory if it has inherited the original inode.
packages/dashmate/src/doctor/removeLegacyReportStagingDirs.js:565-589
A stale approval can still reach recursive removal. Release clears the handle, but removal checks only the saved device and inode, which no longer pin the original directory once the handle closes. The current CLI does not reuse a released candidate, so this is a helper-level gap, not a failure in the normal prompt flow. Reject a released candidate before inspecting or moving its path, and test that passing one to removal leaves the directory untouched.
source: gpt-6.2-sol (phase2-reviewer: general, architecture-layering, security-auditor)
🟡 Suggestion: A failed final directory stat leaks the discovery handle
Impact: An operator whose temporary filesystem returns an error on the final directory stat leaves a descriptor open for the rest of the report process.
packages/dashmate/src/doctor/removeLegacyReportStagingDirs.js:447-466
verifyStagingDir has already handed discovery an open descriptor when the second fstatSync runs. If that stat throws, the catch adds the path to left without closing the descriptor, and it never reaches found, where prompt or removal cleanup could release it. Return the identity from the successful stat already performed by closeDirectory, or close the descriptor unless ownership has passed to found.
source: gpt-6.2-sol (phase2-reviewer: general, architecture-layering, security-auditor)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); reviewer 5: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 6: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 7: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The diff makes substantial changes to diagnostic redaction, archive creation, and temporary-directory cleanup, but it does not change cryptography, key handling, or any other critical surface defined by the rubric. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
- Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/dashmate/src/config/obfuscateConfig.js`:
- [BLOCKING] packages/dashmate/src/config/obfuscateConfig.js:310-326: A private build URL copied into the node description can retain its access token
Impact: An operator who copies a build URL containing both userinfo and a signed query token into the node description can disclose the token when sharing a doctor report.
The archived description can retain a usable token even though the build argument itself is fully masked. The config scrubber collects the entire non-exempt build argument, but `obfuscateConfig` rewrites the URL's userinfo before `scrubFreeText` looks for that exact value. The rewritten string no longer matches, the query token is not collected separately, and `archiveSamples` writes the config copy without another scrub. Match against the original description before either rule rewrites it, while still masking userinfo in other URLs. Add a round-trip test that checks for the absence of the token itself, not just the original URL.
In `packages/dashmate/src/doctor/createSecretScrubber.js`:
- [SUGGESTION] packages/dashmate/src/doctor/createSecretScrubber.js:109-115: A nested URL password can survive masking when an inner escape changes case
Impact: An operator using a config URL with an encoded upstream URL can disclose the upstream password if a service logs the outer URL with an inner escape spelled in the opposite case.
This misses even a credential with a single case-changed escape. `getUrlCredentials` already collects outer-encoded spellings of credentials from nested query URLs, but by the time this code generates case variants, an inner `%2f` is already `%252f`. The regex sees `%25` and never produces `%252F`. Generate the case variants before applying the existing outer encodings and add an archive test for a log that quotes the full outer URL.
In `packages/dashmate/src/doctor/getSampleFreeTextFields.js`:
- [SUGGESTION] packages/dashmate/src/doctor/getSampleFreeTextFields.js:42-54: An RPC value that looks like a diagnostic fact can bypass secret masking
Impact: An operator sharing a report from a tampered RPC endpoint can disclose a configured secret if the endpoint knows it and returns it in the shape of an exempt diagnostic value.
The archive now skips scrubbing some unverified response values. A normal Tenderdash response reports its own public node ID, but Dashmate accepts the configured endpoint's response as-is, and the exception treats any 40-character hex string at that path as public. Tenderdash has access to its Core RPC password, so a compromised instance can cause that password to be retained if the operator configured one in that format. The Core exception likewise preserves uppercase identifiers that neither Core nor the analyser recognizes as states. Keep only recognized state codes, and preserve the node-ID comparison results separately from the raw RPC values so secret matches can still be masked without changing the diagnosis.
In `packages/dashmate/src/doctor/removeLegacyReportStagingDirs.js`:
- [SUGGESTION] packages/dashmate/src/doctor/removeLegacyReportStagingDirs.js:565-589: Legacy cleanup still accepts a candidate after its discovery handle is released
Impact: A caller that retries with a released candidate can remove a qualifying replacement directory if it has inherited the original inode.
A stale approval can still reach recursive removal. Release clears the handle, but removal checks only the saved device and inode, which no longer pin the original directory once the handle closes. The current CLI does not reuse a released candidate, so this is a helper-level gap, not a failure in the normal prompt flow. Reject a released candidate before inspecting or moving its path, and test that passing one to removal leaves the directory untouched.
- [SUGGESTION] packages/dashmate/src/doctor/removeLegacyReportStagingDirs.js:447-466: A failed final directory stat leaks the discovery handle
Impact: An operator whose temporary filesystem returns an error on the final directory stat leaves a descriptor open for the rest of the report process.
`verifyStagingDir` has already handed discovery an open descriptor when the second `fstatSync` runs. If that stat throws, the catch adds the path to `left` without closing the descriptor, and it never reaches `found`, where prompt or removal cleanup could release it. Return the identity from the successful stat already performed by `closeDirectory`, or close the descriptor unless ownership has passed to `found`.
In `packages/dashmate/docs/commands/doctor/report.md`:
- [SUGGESTION] packages/dashmate/docs/commands/doctor/report.md:28: The guide says health-check results are kept even when the status is masked
Impact: An operator with a configured secret equal to `unhealthy` can share a report that shows asterisks instead of Docker's health status.
The new wording overstates what survives unchanged. The collector replaces probe output but still applies generic string scrubbing to `State.Health.Status`, and the archive writer has no Docker health-status exception either. That collision predates this PR; narrow the new claim to say that the non-output fields remain subject to ordinary masking rather than expanding the preservation policy here.
In `packages/dashmate/src/doctor/archiveSamples.js`:
- [SUGGESTION] packages/dashmate/src/doctor/archiveSamples.js:39-51: Archiving a deeply nested RPC response retains unnecessary ancestry arrays
Impact: An operator collecting a report with a deeply nested RPC response uses more heap during serialization than the field checks require.
The replacer copies the full path for every object in a sample with fact exceptions, even below branches that cannot reach one. The sample keeps those objects reachable, so the `WeakMap` holds arrays whose total size grows with the sum of object depths, on top of the existing cost of pretty-printing JSON. Track only prefixes of known fact paths and scrub unmatched subtrees without storing their ancestry.
In `packages/dashmate/test/unit/doctor/archiveSamples.spec.js`:
- [SUGGESTION] packages/dashmate/test/unit/doctor/archiveSamples.spec.js:345-355: The RPC redaction test can pass with a matcher that flattens dotted keys
Impact: A future path-matching regression could leave a secret at a lookalike RPC key unmasked without failing this test.
The negative cases fail both the path check and the value-shape check. The dotted key's secret is not 40 hex characters, and the secret nested under an empty key is not an uppercase state identifier. Both would still be scrubbed if a matcher joined dotted segments or dropped empty ones. Give the path-test cases secrets that pass the shape checks, and keep the malformed value at the real Tenderdash path as a separate shape test.
Out-of-scope follow-up suggestions (3)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Doctor never reports Drive catching up from the collected status sample —
analysePlatformFactorychecksstatus.sync_info, but collection stores a settled RPC result withsync_infoundervalue.result. The mismatch predates this PR, which changes how status strings are serialized, not how the sync flag is read.- Follow-up: Open a Dashmate follow-up PR to read the flag from the stored result and test the warning against both collected and restored samples.
- Archived ZeroSSL errors lose the provider's explanation — The validator stores an
Errorobject, whosemessageis normally non-enumerable. Archive serialization already omitted that message before this PR, so replay can report an unreachable API where live doctor reports a provider rejection.- Follow-up: Project ZeroSSL failures into a plain diagnostic record with a scrubbed message and test live and archived output in a separate PR.
- Mixed-case percent escapes can still leave a credential visible — For credentials with multiple escapes, the scrubber accepts the configured spelling and the all-upper and all-lower variants, not every combination. That pre-existing limitation is distinct from missing the opposite-case spelling of a single nested escape.
- Follow-up: Track matching each escape's hex digits case-insensitively while keeping the surrounding credential text case-sensitive.
|
Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix; thepastaclaw left review threads unresolved; resolve them. |
… doctor report's free-text config fields The config copy in a doctor report hides a URL's credentials wherever it appears, then masks config secrets repeated in the free-text fields (the node description and contact addresses). A build argument's whole value is one of those secrets, but once the credentials of the same URL quoted in the description were hidden, the quote no longer matched that value, and a token in the URL's query stayed in the archive. In the free-text fields, a URL written with credentials now has its query values hidden as well. Parameter names, the host and the path are kept. Nothing reads these fields as values, so no other config value changes. Test, ✖ before the fix (the query token was in the archive) and ✔ after: the description quotes a build argument's URL with a password and a signed query token; neither is anywhere in the archive, and the restored description keeps the host, path and parameter names. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er case in the doctor report scrub The scrub looks for each config secret with its percent-escapes in upper and in lower case. A URL passed in another URL's query value is encoded once more, so an inner `%2f` is written `%252f`, and the case variants only changed the `%25`. A log quoting the outer URL with the inner escape in the other case kept the inner password. A percent-escape is now also recognised after its `%` is escaped again, so `%252f` and `%252F` are variants of each other. Tests, each ✖ before the fix (the inner password stayed in the archived log) and ✔ after: a config URL carries an encoded inner URL whose password holds a lower-case escape, and a log quotes the outer URL with that escape in upper case; and the same the other way round. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cher that flattens keys The archive keeps a few facts of Core's and Tenderdash's answers, chosen by the keys that lead to them and by their shape. The test's lookalike keys, a dotted key and one under an empty key, held values of the wrong shape, so the shape check alone masked them: a matcher that joined keys with dots or dropped empty keys still passed. Those values now have the shape of the fact they imitate (a 40-hex node ID, an upper-case state), so only the key check masks them; Tenderdash's status gets a dotted lookalike key too. The values of the wrong shape at the facts' real places move to a test of their own. Test-only change. Run against matcher mutants: joining keys with dots, or dropping empty keys, left the old test ✔ and fails the new one ✖; dropping the shape check fails the split-out shape test ✖; all ✔ on the real matcher. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed like other text The guide said the executable and the results of containers' health checks are kept. Only what the checks print is left out; the status, streak, times and exit codes stay, but are scrubbed of config secrets like the rest of the archive's text, so a secret spelled like a health status is masked there. The guide now says so. Docs-only change, no behaviour delta, so no test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er letting go of it Discovery holds each legacy staging directory it finds open, so its identity stays its own until it is removed or let go of. Removal then compared the path with the identity recorded at discovery, but did not check that the directory was still held. A caller passing an entry it had already let go of could have the path inspected and removed on the strength of an identity another directory may have taken by then. The CLI never does this; the helper allowed it. Removal now refuses an entry that is no longer held, before its path is inspected or moved, and reports it as left in place. Test, ✖ before the fix (the directory was looked at and removed) and ✔ after: a directory found and then let go of is passed to removal; it is not looked at, not removed, and reported as left. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t check fails Discovery checks each legacy staging directory through a handle it keeps open, then looks through that handle once more to confirm it is the directory found at the path. If that last look failed, the directory went to the list of those left in place, but its handle was never closed: it was neither found, where removal or release would close it, nor closed on the way out, so it stayed open until the process exited. The handle is now closed whenever that last check fails, as it already was when the check found a different directory. Test, ✖ before the fix (the handle was still open) and ✔ after: the last look through the handle fails; the directory is reported as left, closed to others, and its handle is closed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tor report's free text The query of a URL with credentials in the description was matched with a pattern that ran to the next space. Next to another link, with no space between them, it hid the whole of the next link and the text around it. Matching it also took time that grew with the square of the text when a long list of links had no query. Each URL is now read once: from its credentials to a space, a quote or an angle bracket, as text puts around a link. The query within it is hidden up to the fragment, a URL inside that query is hidden with it, and the next URL is looked for after it. Test, ✖ before the fix (the first link's query swallowed the second link and a closing quote) and ✔ after: links in angle brackets, a quoted link, a fragment, and a URL in a query, in one description. Timing on 116 KB of links, not pinned by a test since it would depend on the machine: 28 s and 44 s before for lists without a query, 32 ms to 151 ms after, against 6 ms to 148 ms before this round's change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ee text of the doctor report In the description and contact addresses, the query values of a URL with credentials were hidden first, and config secrets repeated there were masked after. A secret that runs past the query value holding it, into the fragment for example, no longer matched once that value was hidden, and its rest stayed in the archive. Both are now looked for in the same text and every character either one masks is masked. The secret scrub already masks character for character, and its parameter now says so. Test, ✖ before the fix (the part after the `#` was in the archive) and ✔ after: a build argument's secret holds a `#` and is quoted as a query value in the description; no part of it is in the archive. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nts next to the nested ones Recognising an escape whose `%` was escaped again replaced the earlier case variants instead of adding to them. A nested URL's credential quoted with only the outer URL's escapes in the other case, the inner ones as the config writes them, was matched before that change and no longer was. The scrub now looks for each secret with its plain escapes in upper and in lower case, as before, and with its escapes, nested ones included, in upper and in lower case. Test, ✖ before the fix (the inner password stayed in the archived log) and ✔ after: a log lower-cases the outer URL's escapes and keeps the inner one in upper case. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…facts' real places too The RPC fact test checked that lookalike keys are scrubbed, but the values at the facts' real places were not secrets, so they came back unchanged whether or not the archive kept facts at all. The same secrets now sit at the real places and at the lookalike keys: kept at the first, masked at the second. Test-only change. Run against matcher mutants: with fact exceptions switched off, the old test stayed ✔ and the new one fails ✖; joining keys with dots or dropping empty keys still fails it ✖; ✔ on the real matcher. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Your move: thepastaclaw left review threads unresolved; resolve them. |
|
On the two findings from the last review that are not shown inline:
|
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Changes requested: 1 blocker
- A private build URL copied into the node description can retain its access token —
packages/dashmate/src/config/obfuscateConfig.js:387-407(thread, carried)
Impact: An operator who copies an authenticated build URL with an apostrophe in its artifact path into the node description can disclose its signed query token when sharing a doctor report.
New on this head: This update adds query-value masking to report descriptions and contact addresses, expands nested percent-escape coverage, strengthens the RPC fact tests, and fixes two legacy staging-handle paths. The JS build and lint, Dashmate tests and all three Dashmate E2E jobs, the platform suite, and both browser shards passed; PR Hygiene is still pending.
🔴 1 blocking | 🟡 3 suggestion(s)
Still open from earlier rounds (4)
- 🔴 Blocking: A private build URL copied into the node description can retain its access token —
packages/dashmate/src/config/obfuscateConfig.js:387-407(thread) - 🟡 Suggestion: A nested URL password can survive masking when an inner escape changes case —
packages/dashmate/src/doctor/createSecretScrubber.js:116-126(thread) - 🟡 Suggestion: An RPC value that looks like a diagnostic fact can bypass secret masking —
packages/dashmate/src/doctor/getSampleFreeTextFields.js:42-54(thread) - 🟡 Suggestion: Archiving a deeply nested RPC response retains unnecessary ancestry arrays —
packages/dashmate/src/doctor/archiveSamples.js:39-51(thread)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The PR changes redaction, diagnostic archives, and filesystem cleanup across Dashmate, but it does not change a critical surface such as cryptography, key handling, or storage migrations. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/dashmate/src/config/obfuscateConfig.js`:
- [BLOCKING] packages/dashmate/src/config/obfuscateConfig.js:387-407: A private build URL copied into the node description can retain its access token
(carried; thread: https://github.com/dashpay/platform/pull/6325#discussion_r4709781190)
In `packages/dashmate/src/doctor/createSecretScrubber.js`:
- [SUGGESTION] packages/dashmate/src/doctor/createSecretScrubber.js:116-126: A nested URL password can survive masking when an inner escape changes case
(carried; thread: https://github.com/dashpay/platform/pull/6325#discussion_r4709781204)
In `packages/dashmate/src/doctor/getSampleFreeTextFields.js`:
- [SUGGESTION] packages/dashmate/src/doctor/getSampleFreeTextFields.js:42-54: An RPC value that looks like a diagnostic fact can bypass secret masking
(carried; thread: https://github.com/dashpay/platform/pull/6325#discussion_r4709781219)
In `packages/dashmate/src/doctor/archiveSamples.js`:
- [SUGGESTION] packages/dashmate/src/doctor/archiveSamples.js:39-51: Archiving a deeply nested RPC response retains unnecessary ancestry arrays
(carried; thread: https://github.com/dashpay/platform/pull/6325#discussion_r4709781249)
|
Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix. |
…port The node description and the Let's Encrypt contact address are free text an operator writes, and no analyser reads them. Looking for secrets and links inside that text kept producing new edge cases: an authenticated URL with an apostrophe in its path, pasted into the description, kept its signed query token, because URL detection in free text stopped at the apostrophe (review thread r4709781190). The config copy now carries `<redacted>` for each of these fields when it is set, and keeps an empty or null value as it is, so the report still says whether it was set. The fields are recognised where the schema puts them, so a JSON access log template field with the same name keeps its value. The Let's Encrypt check's sample, which reported the same contact address, now leaves it out. The free-text URL query parsing and obfuscateConfig's free-text scrubber existed only for these fields and are removed. Structured values keep their handling: URL credentials hidden, the home directory masked in paths. Test would have caught this in CI: ✖ before the fix (the apostrophe URL's token, an authenticated URL's host and path, and a plain sentence all reached the archive, the contact address stayed in the SSL sample, and an access log template field named `description` was replaced once fields were matched by name), ✔ after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… contact address out The guide and the report's confirmation prompt said the user name and copies of config secrets were masked in the node description and the contact addresses. Both fields are now left out of the archive's copy of the configuration, which only says whether each was set, and the contact address is left out of the certificate check's results. Logs can still quote the contact address, such as an error from the certificate tool, and the texts say so. The user name is masked in logs and paths. No test: wording only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Updated after discussion: 1 finding(s) of this review were settled in the inline threads.
- ⏭️ Deferred (maintainer decision): 🟡 A nested URL password can survive masking when an inner escape changes case (tracked in #6342)
New on this head: Dashmate’s doctor report now replaces a set node description and Let’s Encrypt contact address with <redacted> in the archived config and omits the address from the certificate-check sample. The guide and confirmation prompt explain that service logs can still quote the address. The JavaScript build, lint, Dashmate tests, and all three Dashmate end-to-end jobs passed; the main platform suite and one browser shard were still pending.
🟡 2 1 suggestion(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
Still open from earlier rounds (1)
- 🟡 Suggestion: An RPC value that looks like a diagnostic fact can bypass secret masking —
packages/dashmate/src/doctor/getSampleFreeTextFields.js:42-54(thread)
⏸️ Awaiting tracking link (1): A nested URL password can survive masking when an inner escape changes case (thread). Link an issue on its thread, or ask there and PastaClaw files it.
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — The diff makes substantial changes to diagnostic redaction, archive handling, and staging cleanup, but it does not change a critical surface such as cryptography, key handling, or storage migrations. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `packages/dashmate/src/doctor/getSampleFreeTextFields.js`:
- [SUGGESTION] packages/dashmate/src/doctor/getSampleFreeTextFields.js:42-54: An RPC value that looks like a diagnostic fact can bypass secret masking
(carried; thread: https://github.com/dashpay/platform/pull/6325#discussion_r4709781219)
In `packages/dashmate/src/doctor/createSecretScrubber.js`:
- [SUGGESTION → DEFERRED by a maintainer; not blocking, do not fix in this PR] packages/dashmate/src/doctor/createSecretScrubber.js:109-115: A nested URL password can survive masking when an inner escape changes case
(awaiting a tracking link: link an issue on its thread, or ask there and PastaClaw files it; no code change needed; thread: https://github.com/dashpay/platform/pull/6325#discussion_r4709781204)
|
Bots are done — your move: post |
…atform-impl Brings in #6319 as squash-merged (f4176c4), the 5.1.0 sync #6333 and #6325. Merged with merge drivers off. Conflicts: - docs/commands/reset.md, src/commands/reset.js, src/listr/tasks/resetNodeTaskFactory.js: this branch's version. v5.2-dev's copy of each is byte-identical to #6319's final head 3a5478d, which this branch already merged, so nothing else came in. - docs/update.md: v5.2-dev's apt-based install/update flow and its chain restart section as they are; this branch's "Starting Platform Over" and "Lost node key" follow "Do not add --hard", whose closing paragraph now names setup --platform as the way back. The old soft-reset section is replaced by v5.2-dev's. - ssl/zerossl/validateZeroSslCertificateFactory.js and its spec: #6316's rule (the API key stays out of the result) combined with this branch's rewrite; the ZeroSSL call keeps the abort signal. Both sides' tests kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Issue being fixed or feature implemented
Follow-ups to the
dashmate doctor reportredaction in #6316. Each item was deferred in a #6316 review thread with the reply "Deferred to a follow-up change", and this PR does what those replies promised:gateway.ssl.errorcode (thread) and the installed certificate's facts (thread), and keep scrubbing their free textIt also takes two small items from #6316's earlier follow-up list: percent-escapes matched in either case, and the free-text config fields, which are now left out of the report.
And it takes four suggestions from the review of #6323, the merge this PR was stacked on:
Fixes #6320
What was done?
One commit per item, each with a test that fails before the change and passes after it.
Sample field policy (
getSampleFreeTextFields,archiveSamples,collectSamplesTaskFactory)Live
doctoranalyses the collected samples, anddoctor -sanalyses the archived ones. The report scrubs config secrets from both. Before this PR, some samples were scrubbed in full, including values the analysers decide on. A secret spelled like one of those values then changed the diagnosis. The renewal record already had a field policy for this, and it now covers the other certificate samples:gateway.sslerror(the check's outcome, whichanalyseConfigswitches on)datagateway.installedCertificatemessagegateway.servedCertificatematchesOnDisksubject,issuer,subjectAltName,serialNumber,identityErrorDoctor compares the installed certificate's fingerprint with the served one's. Keeping only the first would make that comparison fail in an archive where a secret matches part of the fingerprint, so
servedCertificateis in the table too. A listed field is now free text including everything nested in it. The archive writer follows that through nested values, so all of the SSL check'sdatais scrubbed.Health check output
State.Health.Log[].Outputis replaced with<redacted>, the same marker as the health check command. The status, failing streak, start and end times and exit codes stay. No analyser reads the output.Renewal record
RenewalRecord#toDiagnosticObject()is the copy the report collects. A provider outsideSSL_PROVIDERSbecomesunknown, and a code outsideRENEWAL_FAILURE_CODESbecomesUNKNOWN. The diagnosis does not change: an unfamiliar provider never matches the configured one, and every code check compares with a known code.fromObject, which reads the record from disk, stays as tolerant as before.Legacy staging cleanup (
removeLegacyReportStagingDirs,legacyReportCleanupTasks).dashmate-report-removal-*directories as left by a removal that did not finish. They are never removed or changed, and they are printed even when nothing else is found.Scrubber (
createSecretScrubber)Each secret is also searched for with all its percent-escapes in upper case and with all of them in lower case.
Free-text config fields (
obfuscateConfig,collectSamplesTaskFactory)The node description and the Let's Encrypt contact address are free text an operator writes, and no analyser reads them. The archive's copy of the configuration carries
<redacted>for each of them when it is set, and keeps an empty or null value, so it still says whether each was set. They are recognised where the schema puts them, so a JSON access log template field with the same name keeps its value. The Let's Encrypt check's results no longer include the contact address. No secret or link is looked for inside this text any more, so the URL parsing that existed for it is removed. Structured config values keep their handling: URL credentials hidden, the home directory masked in paths.Docs and prompt
docs/commands/doctor/report.mdand the report confirmation prompt now say:Both still tell the operator to review the archive before sharing it.
From #6323's review (
archiveSamples,getSampleFreeTextFields,report.js)Core's and Tenderdash's answers get a keep-list. These answers are not dashmate's to list field by field, so the policy is the opposite of the certificate samples'. Every string is scrubbed, except facts named by the keys that lead to them and kept only when they look like what they are:
masternodeStatus.state, kept when it is an identifier;masternodeStatus.dmnState.platformNodeID;nodeIdFromKey);status(value.result.node_info.id).Each node ID is kept only when it is 40 hex characters. The registered ID is compared with each of the other two, so all three are kept: keeping only one would turn a match into a mismatch. Node IDs are public, because Tenderdash announces its own to every peer. (thread)
A failed removal of the staged samples is reported. When packing fails and the staged samples cannot be removed, the packing error still comes first, as the same error with its code. Its message adds the staging directory to remove and why it could not be removed. Also:
doctor reportwraps its output instead of cutting it at the terminal's width, so these paths are shown in full.(thread)
An empty staged listing is refused before the partial archive file is opened. Any failure after the open now closes the file before removing it: the raw descriptor, or the stream once it exists. (thread)
The listing-error test stubs
os.tmpdir(), so the writer and the injected failure agree where Node does not readTMPDIR. (thread)From this PR's review (
obfuscateConfig,createSecretScrubber,removeLegacyReportStagingDirs, docs)%is escaped again (%252fand%252F), as in a URL nested in a query value. The plain-escape variants are kept next to these.Not done (left for later)
archiveSamples.spec.jsassumes a non-Windows temp directory.Error.messageis not enumerable), sodoctor -sreports the API as unreachable where livedoctorquotes ZeroSSL's message.status.sync_info, but the collected status sample keeps it undervalue.result, so the warning never shows.How Has This Been Tested?
Locally on macOS:
yarn test:unit): 1352 passing, 0 failing.yarn lintinpackages/dashmate: 0 errors. The 46 warnings are in files this PR does not touch, and the changed files pass with--max-warnings 0.servedCertificatepolicy fails the fingerprint test;POSE_BANNEDand like part of the registered ID. Both live and from the archive, the ban is reported and no node ID mismatch is.os.tmpdir()stub is a test-only change. It was shown red, then green, with the writer staging outside the test's root, as on Windows.One independent review of the plan. Its must-fixes were folded in: the
servedCertificatepolicy, a diagnosis-level reason-code test, idempotent release, and simpler percent-escape variants.One Codex (gpt-6.2-sol, xhigh) pass on the diff. It found two must-fixes in this PR's own changes, and both are fixed: the served certificate's serial number is scrubbed, and the held handle is the one the directory was checked through. Its other findings predate this PR and are listed under "Not done". The fixes were not re-reviewed by Codex.
One Codex (gpt-6.2-sol, xhigh) pass on the four commits taken from the chore: merge v5.1-dev into v5.2-dev #6323 review. Its six must-fixes were folded into those four commits, test-first:
These fixes were not re-reviewed by Codex.
One Codex (gpt-6.2-sol, xhigh) pass on the commits answering this PR's review. Its three must-fixes were folded in as their own commits, test-first:
Its one suggestion, the same secrets at the facts' real places in the RPC test, is folded in too. These fixes were not re-reviewed by Codex.
One Codex (gpt-6.2-sol, xhigh) pass on the commits that leave the free-text fields out. Its three must-fixes were folded into those commits, test-first:
descriptionoremailkeeps its value;These fixes were not re-reviewed by Codex.
Not run: a real
dashmate doctor reportanddoctor -sagainst a running node, Windows, and the dashmate integration and e2e tests.Breaking Changes
None.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull request (N/A)For repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
af2ab5f/self-reviewedWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.