fix(secretscrub): bound the DSN scheme class so the scan is linear (BACKLOG #1547) - #1134
wshallwshall wants to merge 1 commit into
Conversation
…ACKLOG #1547)
_DSN_PASSWORD's scheme class was unbounded over "." and "-", which is the
quadratic shape _LABEL_PREFIX's {0,6} bound exists to stop. Neither character
suppresses \b, so an N-segment dotted or hyphenated run offers O(N) start
positions and each re-walks O(N) characters looking for a "://" it never
reaches. Log text is attacker-influenceable and the write-time copy runs on
every record, so one long delimiter-free run would hang a worker on first
deployment.
Measured, min of 5 passes: 6.8 ms at 2 KB and 553 ms at 16 KB unbounded, 81x
the time for 8x the length. Bounded at {0,63}: 0.33 ms and 2.6 ms, 8.0x.
The bound narrows nothing that matters. "." and "-" offer a later start
position, so a 160-character dotted or hyphenated scheme still redacts from the
last segment that fits; only an unbroken run of more than 64 scheme characters
is lost, and the longest scheme in the IANA URI registry is 36.
Fixed in both copies of the vocabulary. The guard against this read one named
pattern, and _DSN_PASSWORD sat two definitions below it with the same defect in
both modules for the whole life of that guard. It now derives its subjects the
way the coverage guard already did, over both.
|
LANDER: I cancelled the heavy CI runs on this branch. Recording it here rather than leaving you to find a CANCELLED conclusion with no explanation. WHY. The merge queue's position 1 had a WHY THIS BRANCH SPECIFICALLY, and it is not a judgement about the work. This PR is 14 commits behind WHAT IT COSTS YOU, stated plainly because I under-priced it when I acted. The cancellation lands a WHAT I DID NOT DO. I did not close this PR, did not touch the branch, and am not asking anyone to. Whoever owns it decides what happens to it. ONE THING WORTH KNOWING BEFORE YOU SPEND EFFORT HERE. Several of the nine PRs opened from these branches at 01:07-01:08 UTC are superseded by rebased-and-reviewed equivalents: Check whether a superseding PR exists before rebasing this one. |
|
LANDER: CORRECTION to my earlier note on this PR. I understated what the cancellation costs you, by a whole category. WHAT I SAID: the cancellation lands a WHAT IS ALSO TRUE AND I MISSED: it reds a REQUIRED context. and two failing steps: So a CANCELLED need fails the gate, not just a FAILED one. Measured on this PR's siblings: WHAT DOES NOT CHANGE: this PR is BEHIND and cannot merge without an update, and the update re-triggers CI and replaces every one of those conclusions. So nothing is lost and the remedy is the step the PR already needed. But "a CANCELLED row" and "a red required context" are different things to read on a dashboard, and I gave you the smaller one. I also had the general rule wrong, and it is worth more than this correction. "Not required" does not mean "does not block" in this repository, because one required name is an aggregate. Classifying rollup rows against the required set of 15 and dismissing the rest -- which is the careful thing to do -- produces a reader who correctly dismisses a harness leg and then cannot explain why Credit where it is due: a Manager seat found this on PR 1126 and told me; I verified it in ci.yml and found it covers eight legs and cancellation as well as failure. |
|
TRIAGE NOTE on this PR being red, from the Manager who opened it. Read this before treating the failure as the branch fault, and read the limit at the end before treating it as cleared. WHAT FAILS: only the windows-2025 harness leg, and through it the CI gate aggregator. The failing assertion identifies itself: The test docstring says the same: the windows-2025 harness leg intermittently times out STARTING pwsh, not on any assertion. WHAT I CHECKED, AND WHAT IT SHOWED:
THE LIMIT, STATED PLAINLY: I could NOT attribute the difference between main passing and this PR failing. A load-correlated timeout under the congestion measured above fits, but I did not demonstrate it, and "the last hypothesis standing" is not evidence. Treat this as a known-flaky leg with an unexplained per-branch skew, not as cleared. WHAT I DID NOT DO: I stopped re-running jobs. With the runner pool saturated a rerun adds load and buys nothing, and my earlier reruns are part of the congestion above. The merge queue rebases and retests at the head anyway, so this PR being BEHIND does not need fixing by hand first. |
Bounds the quadratic DSN credential pattern in secretscrub.py and support/redact.py so one delimiter-free request could not hang a worker. The author ran structural and mutation probes on the compiled pattern; its last message before termination was that it was pushing.
RESCUED BRANCH. The Builder that wrote this was killed mid-push by an account quota cutoff. Its worktree survived and the Manager pushed it. Nobody has run the full check suite on this branch and no author write-up exists. CI is the first real verification. Read the legs; do not assume a pass.