Repository navigation
fix: escape quotes in notebook viewer esc(); strip nested Java generics (CodeQL) - #178
Merged
Merged
Conversation
…generics (CodeQL)
- kb view template: esc() escaped only & < >, but feeds double-quoted attributes
(data-dir="${esc(path)}"), so a path or note title containing a quote could
close the attribute. Now also escapes " and '. Site copy regenerated.
Clears code-scanning alerts #12-20 (js/incomplete-html-attribute-sanitization).
- java.ts stripGenerics: one `<[^>]*>` pass turned `Map<String, List<String>>`
into `Map>`, a name that matches no class. Strip innermost `<...>` repeatedly.
Not a security issue (alert #3 is a false positive) but a real resolution bug.
- parser.ts extractSfcScripts: accept `</script >` (space before `>`), alert #5.
Java probe (scripts/probe-repos.mjs), before -> after:
kafka: edges 48881 -> 49034 (+153), java resolved 48376 -> 48529,
java ratio 49.7% -> 50.9%
jmri: edges 34229 -> 34230 (+1), java resolved 34212 -> 34213,
java ratio 37.7% -> 37.8%
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…js/bad-tag-filter) HTML parsers allow whitespace and junk attributes in an end tag, so </script\t\n bar> closes a block. The end-tag regex now matches that too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Sep 29, 2026
Merged
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.
Addresses the open CodeQL alerts. I read the code behind all 13; two root causes are worth fixing, two are false positives.
Fixed here
js/incomplete-html-attribute-sanitizationesc()insrc/kb/view-template.tsescaped only& < >but feeds double-quoted attributes (data-dir="${esc(path)}"). A file path or note title containing"could close the attribute. Now also escapes"and'. Site copysite-astro/src/notebook-page.htmlregenerated (CodeQL scans that copy).js/incomplete-multi-character-sanitization(java.ts)stripGenerics('Map<String, List<String>>')returnedMap>. Now strips innermost<...>repeatedly, soOuter<T>.Inneris stillOuter.Inner.js/bad-tag-filter(parser.ts)</script >(space before>) is a valid end tag; now matched.Java resolution, before -> after (
scripts/probe-repos.mjs, Java repos only)extends/implementslines with nested generics, jmri has 4.Map>no longer count as unresolved. The real new edges are the +153 / +1.extends/implementsand field/param types (both usestripGenerics).Not fixed (to dismiss on GitHub after review)
<script>bodies for the parser, never rendered. False positive.--match /regex/): user-supplied regex is the documented feature; worst case is a hung local process from a pathological pattern. Won't fix.Notes
stripGenericsnested, extends/implements names,escquotes). Full suite 873/873,tscclean.🤖 Generated with Claude Code