The problem
User-pasted contract source (up to 500,000 characters per lib/codeStore.ts) eventually gets rendered by components/CodeViewer.tsx. Depending on how that component renders (syntax highlighting libraries sometimes have their own HTML-generation paths), there's a real question of whether extremely large or specially-crafted source input could cause rendering performance problems or, in the worst case, any kind of injection issue — this needs to be verified, not assumed safe.
Why this is hard
Verifying this properly means understanding exactly how the syntax highlighter renders content (does it produce React elements safely, or does it ever touch dangerouslySetInnerHTML?) and stress-testing with pathological input (extremely long single lines, deeply nested comment-like structures, unusual Unicode) rather than just normal Rust source.
Direction
- Audit
CodeViewer.tsx and whatever syntax-highlighting mechanism it uses for any dangerouslySetInnerHTML or equivalent raw-HTML-insertion path
- Stress-test rendering with pathological input (very long lines, unusual Unicode, adversarially crafted comment-like content) and fix any performance or rendering issues found
- Add a rendering-side length/line-count guard independent of the storage-side cap in
codeStore.ts, since a future change to that cap shouldn't silently remove this protection
Acceptance criteria
Relevant files: components/CodeViewer.tsx, lib/codeStore.ts
This is part of a deliberately hard "challenge" batch — the goal is a real rebuild/fix, not a cosmetic patch. Open a draft PR early and describe your approach before going deep.
The problem
User-pasted contract source (up to 500,000 characters per
lib/codeStore.ts) eventually gets rendered bycomponents/CodeViewer.tsx. Depending on how that component renders (syntax highlighting libraries sometimes have their own HTML-generation paths), there's a real question of whether extremely large or specially-crafted source input could cause rendering performance problems or, in the worst case, any kind of injection issue — this needs to be verified, not assumed safe.Why this is hard
Verifying this properly means understanding exactly how the syntax highlighter renders content (does it produce React elements safely, or does it ever touch
dangerouslySetInnerHTML?) and stress-testing with pathological input (extremely long single lines, deeply nested comment-like structures, unusual Unicode) rather than just normal Rust source.Direction
CodeViewer.tsxand whatever syntax-highlighting mechanism it uses for anydangerouslySetInnerHTMLor equivalent raw-HTML-insertion pathcodeStore.ts, since a future change to that cap shouldn't silently remove this protectionAcceptance criteria
Relevant files:
components/CodeViewer.tsx,lib/codeStore.tsThis is part of a deliberately hard "challenge" batch — the goal is a real rebuild/fix, not a cosmetic patch. Open a draft PR early and describe your approach before going deep.