Repository navigation
Replies: 1 comment
|
The measured result makes the proposed fix compelling: parsing a CSS response with a JavaScript tree-sitter parser turns a recoverable classification mistake into a multi-gigabyte process failure. Excluding CSS from the JSLuice path while keeping CSS discovery through the regex parser is the right separation. I would add a few cases to the regression matrix:
The eligibility code should normalize the URL path and content type, use an explicit JavaScript MIME allowlist rather than a broad substring where possible, and make the precedence between extension and content type clear. Even with correct classification, a parser budget or cancellation path would keep one hostile or pathological response from exhausting the whole scan. A test that runs both -jsl and -jc on the same CSS fixture would also protect the intended behavior: CSS endpoint discovery remains available, but the JavaScript AST extractor is never invoked for CSS. |
Uh oh!
There was an error while loading. Please reload this page.
When
-jslis enabled, Katana sends responses whose path ends in.cssto JSLuice's JavaScript tree-sitter parser. A minified stylesheet causes an out-of-memory failure.The current eligibility check explicitly accepts both
.jsand.css:katana/pkg/engine/parser/parser_generic.go
Lines 56 to 69 in 0265c67
Expected Behavior:
The JSLuice JavaScript parser should process only responses whose URL path has a JavaScript extension or whose content type indicates JavaScript. A
.cssresponse with a CSS content type should not be parsed as JavaScript.CSS relative-endpoint extraction can remain handled by the regex parser enabled by
-jc; excluding CSS from-jsldoes not require excluding it from Katana's CSS endpoint discovery.styles.css
What I measured
v1.6.1,-jslv1.6.1, without-jslv1.6.1,-jslThe locally tested fix removes
.cssfrom the JSLuice eligibility condition while preserving JavaScript content-type detection:All reactions