Repository navigation
Conversation
urlHoldsUserinfo renders a value once per ${VAR:-fallback} reference and
reads it whole each time, so a 64 KB URL field of fallbacks took 4-14 s
(finding 1265). Charge every URL field to the document's work budget
that env values already spend, refusing past it as too costly to check,
and render only the first fallback alone for the baseUrl scheme-slash
rule, which reads only the text before the first variable.
Each of the five URL fields, with 60 KB of fallbacks in the path or the authority, and a Preset URL around a variable, are refused as too costly in under 500 ms (main: 4-14 s, or saved). A short fallback with userinfo is still refused and a plain one saved.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review blockedAutomated review did not run, so no review verdict was produced. Reason: The input-safety check rejected material in this revision. No detected value, path, or scanner output is reproduced here. Automatic review is on hold, including after source changes. Request a fresh re-review after resolving the failure; maintainers can also release the hold through an intentional scanner-policy update. Next step: If this is a genuine credential, remove and rotate it. If it is an intentional test fixture, a maintainer must review and qualify it. |
freeqaz
had a problem deploying
to
integration-qa-pr
October 13, 2026 19:58 — with
GitHub Actions
Error
freeqaz
had a problem deploying
to
integration-qa-pr
October 13, 2026 19:58 — with
GitHub Actions
Error
Review nits: a Preset URL of thousands of variables cost about 0.5 s under the budget, as each variable costs every rendering a fixed amount; charge about a dozen characters for each. environmentUrls tested a covered reference's whole text for an authority end once per colon in it (70-125 ms on a 60 KB value, uncharged); remember the answer per reference instead.
This was referenced Oct 13, 2026
This branch was successfully deployed
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.
Problem
urlHoldsUserinforenders a URL once per${NAME:-fallback}reference (plus three more times) and reads the whole text each time, so its cost is quadratic in the number of fallbacks. #2353 bounded this for environment values with a per-document work budget, but every other URL field it checks was still unbounded:baseUrl,request.proxy.url,proxy.proxyUrl, channel and account proxies, MCP server URLs, Codex and speech proxies. The baseUrl scheme-slash rule (writesSchemeSlashes, #2351) used the same renderings. A member can write Configurations and Presets, so one save could hold the controller for seconds.Measured on main (abf6647), one 64 KB value of
${A:-x}fallbacks,validateModelCredentialReferences/validateModelProviderSettings:baseUrlrequest.proxy.urlproxy.proxyUrlChange
refuseUrlUserinfo(every URL field) now charges the document's work budget that fix(presets): refuse url userinfo in every env map and any env value with a scheme #2353 added for environment values, before it checks: the text length times (3 + its${NAME:-fallback}references), once per check (twice for a schemeless proxy). Past the budget (2^22 characters read) the field is refused with the existing "too many URLs or${NAME}references" message, which now says "with the URLs and environment values before it", as URL fields come first. A proxy environment variable's whole-value check is charged there once instead of insideenvironmentUrls.The budget never skips a check: a value is either fully checked as before or refused. So it cannot accept anything main refuses; it only refuses values whose check would exceed the budget (about 5 KB of back-to-back fallbacks in one URL, or about 1 MB without any, beyond the 64 KiB request body).
writesSchemeSlashesreads only the text before the first unset reference. Rendering one fallback alone leaves that text as when every reference is set, except for the first fallback (fallbacks are numbered in order), so the baseUrl rule now renders only none, all, and the first fallback alone: three renderings, linear time, same result.Review follow-ups: each unfilled Preset variable is charged about a dozen characters per rendering (a 63 KB Preset URL of 6,000 variables cost about 0.5 s under the budget; now refused at once), and
environmentUrls(fix(presets): refuse url userinfo in every env map and any env value with a scheme #2353) remembers whether each reference's text ends an authority instead of reading it once per colon inside it (70-125 ms on a 60 KB value, uncharged). The second is exact: same answer, read once.Why not a single-pass algorithm for
holdsUserinfo: each per-fallback rendering changes where the scheme, authority, brackets and port end, and the URL parser's view of them. A rewrite that provably keeps every accept and refuse result of #2347/#2350/#2351/#2353 is a large change to a credential check; the budget keeps the existing check unchanged for every value it admits.Verification
Configuration and Preset saves check a URL of many ${NAME:-fallback} references in bounded time: the five URL fields in both shapes and a Preset save, each refused with the cost message in under 500 ms (a few ms measured), plus a short fallback that still carries userinfo (refused) and a plain one (saved). Against main's sources the same test fails 12 of 13 subtests (saved with 201, or refused for userinfo after seconds)./,\,https:, tabs, controls, several Preset literals) compared every rendering against the three: 0 mismatches. A negative control rendering no fallback alone found 232 mismatches in 200,000.configuration-controller.test.mjs(51 tests),kubernetes-compute.test.mjs(349) andkubernetes-configuration.test.mjs(23): every baseUrl scheme-slash call gave the same result both ways, and none of the 324 URL userinfo checks hit the budget. All pass.configuration-controller.test.mjs,kubernetes-compute.test.mjsandkubernetes-configuration.test.mjs20/20 pinned to 2 CPUs: 20/20 each, 0 failures.baseUrl,proxy.proxyUrl,HTTPS_PROXY,PIP_INDEX_URLand a channel proxy, as Configurations and as Presets) found no value main refuses that the fix accepts; rerun on the final head, the only differences are 7 proxy env values main refused on cost alone (it charged them more); main with its budget removed accepts all 7, so none holds a credential.tsc --build tsconfig.json, eslint and prettier on the touched files.Risks
stored).