Repository navigation
fix(core): a logo attribute whose url( isn't CSS is refused, not a crash - #728
Merged
Merged
Conversation
Owner
Author
|
Review, round 1 (GPT 6.1 Sol, xhigh, in Codex): no findings. All four regression inputs throw on main and are refused with a line naming the attribute on this branch; the 38 focused look tests pass. Sol agreed the nested |
allisonmahmood
force-pushed
the
fix/722-logo-url-refusal
branch
from
October 18, 2026 00:11
9a67f86 to
d3926af
Compare
checkLogo read any attribute holding url( as a CSS value, and css-tree's value context throws on input it can't read: a SyntaxError for text such as `a url(x) b ;}`, and a RangeError for brackets nested past the stack. Both escaped checkLook, crashing `patchy look publish` and `look preview` and turning a publish into a defect instead of InvalidLook. The value parse now catches those two errors and the logo is refused with a line naming the attribute. The failure is cached like any other parse. Closes #722 Co-Authored-By: Claude Opus 5.5 <[email protected]>
allisonmahmood
force-pushed
the
fix/722-logo-url-refusal
branch
from
October 18, 2026 12:01
d3926af to
64fe998
Compare
allisonmahmood
added a commit
that referenced
this pull request
Oct 19, 2026
…ng Reconnecting (#783) Release 14's What's new entry, written from \`7694bab\`. It covers everything merged since release 13's \`through\` (\`c9b8fc4\`), and sets the \`patchy\` release to \`0.14.0\` (\`packages/patchy/package.json\` and \`CURRENT_RELEASE\`). | Change | PRs | | --- | --- | | Improved: Tools with server code answer faster | #756, #764, #768, #769, #771, #772, #773, #775, #778 | | Improved: Your company's tools and pages open sooner | #759, #761, #766, #770 | | Fixed: Tools stop flashing Reconnecting while they load | #755, #776, #780 | | Improved: Publishing is quicker | #729 | | Improved: New tools start with a tidy layout | #763 | | Improved: Your usual is easier to scan | #721 | | Fixed: A page that isn't there says what to do | #762 | | Fixed: A logo Patchy can't read is refused, not a crash | #728 | | Behind the scenes: richer logs for live data | #758 | #720 is release 13's own entry, so it's left out. Made by Claude Opus 5.5 via Claude Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
A logo with an attribute that holds
url(but doesn't read as a CSS value crashedcheckLook.patchy look publishandpatchy look previewdied with an unexpected error, and a publish through the API was a 500 defect instead ofinvalid_look.Fix
checkLogoreads any attribute containingurl(as a CSS value to find what it points at. css-tree never callsonParseErrorin itsvaluecontext; it throws instead. That's aSyntaxErroron text it can't read (a url(x) b ;},url("a" b,url(x)) {) and aRangeErroronce brackets nest past the stack (about 2,300 deep, a few KB). That one parse now catches both, and the logo is refused with a line naming the attribute:The failure is cached like a successful parse, so a repeated attribute parses once. The
stylesheetanddeclarationListparses still rethrow: they recover from bad syntax, so a throw there means something else.Why refuse instead of ignoring non-presentation attributes. Ignoring them needs a list of every attribute browsers read as CSS, and a gap in that list would let a reference through unchecked. A malformed presentation attribute such as
fill="url(x)) {"would still need this refusal. Refusing keeps the check conservative: it can only over-refuse free text that containsurl(and also isn't CSS, which real logos rarely have, and the line says how to fix it.Hit every surface
look.test.ts, beside the other logo refusals.packages/core/fixtures/looksholds only accepted looks, so no fixture changes.Looks.publishalready turns any non-emptycheckLookresult intoInvalidLook, asLookApi.test.ts("refuses a look that fails its checks") shows, so this logo now lands as 422invalid_look.packages/patchy/README.mdand thepublishLookdescription already say everyurl()is adata:URL or a#fragmentlink. An unreadable one can't be shown to be either, so neither needs changing.Not in this PR
Deeply nested blocks, such as thousands of
@media{inlook.cssor a logo<style>, parse fine but overflow the stack in css-tree'swalk/generate, socheckLookstill throwsRangeErrorthere. That needs a nesting bound, not a catch. It's noted on #722 for its own issue.Closes #722
Built by Claude Opus 5.5 in Claude Code, running in T3 Code; reviewed by GPT 6.1 Sol in Codex.