Skip to content

fix(charts): strip title markup to a fixpoint, not one pass (code-sca… - #136

Closed
hyperpolymath wants to merge 2 commits into
mainfrom
arena/c252f605-f142-49c0-a346-c7e469160212-metamanifold-webui
Closed

hyperpolymath wants to merge 2 commits into
mainfrom
arena/c252f605-f142-49c0-a346-c7e469160212-metamanifold-webui

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

…nning 4, 5)

Both open code-scanning alerts are the same rule,
js/incomplete-multi-character-sanitization (CWE-020/080/116, high), on the same shape: text.replace(/<[^>]+>/g, '') stripping the pseudo-HTML Plotly accepts in titles. One pass can reintroduce the dangerous sequence — "<scr<script>ipt>" loses its inner tag and the halves join into a fresh "<script>" — so the strip now lives in one shared helper, stripHtmlTags in utils/text.ts, and repeats until the text stops changing. Behaviour on ordinary titles (CO2, ,
) is identical: the second pass finds nothing and changes nothing.

Used at both flagged sites — the pane title width measurement in figure/charts.ts and the report figure title in components/AnalysisChart.tsx — and pinned by new tests in utils/text.test.ts covering the split-tag case, normal markup, and bare ">" text.

Generated by Mistral Vibe.

Summary

Closes #

Type of change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (would change existing behaviour)
  • 🕳️ Soundness fix (fixes a checker/proof false-negative)
  • 📖 Documentation
  • 🧹 Refactor / tech debt (behaviour-preserving)
  • ⚡ Performance
  • 🔧 Build / CI / tooling

How has this been verified?

Checklist

  • My commits are signed (git commit -S).
  • I ran the project's own checks/tests locally and they pass.
  • New files carry the correct SPDX-License-Identifier (code/config MPL-2.0,
    prose CC-BY-SA-4.0); I did not relicense existing files.
  • Docs are updated, and no public claim now overstates what the code does.
  • I have not introduced a soundness hole (or I have flagged where I might have).

Notes for reviewers

…nning 4, 5)

Both open code-scanning alerts are the same rule,
js/incomplete-multi-character-sanitization (CWE-020/080/116, high), on
the same shape: text.replace(/<[^>]+>/g, '') stripping the pseudo-HTML
Plotly accepts in titles. One pass can reintroduce the dangerous
sequence — "<scr<script>ipt>" loses its inner tag and the halves join
into a fresh "<script>" — so the strip now lives in one shared helper,
stripHtmlTags in utils/text.ts, and repeats until the text stops
changing. Behaviour on ordinary titles (CO<sub>2</sub>, <b>, <br>) is
identical: the second pass finds nothing and changes nothing.

Used at both flagged sites — the pane title width measurement in
figure/charts.ts and the report figure title in components/AnalysisChart.tsx
— and pinned by new tests in utils/text.test.ts covering the split-tag
case, normal markup, and bare ">" text.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c2b0c622-b119-49ec-9daf-59a0d985bb7c
📥 Commits

Reviewing files that changed from the base of the PR and between 15a6b5d and dbfef5b.

📒 Files selected for processing: 4
  • frontend/src/components/AnalysisChart.tsx
  • frontend/src/figure/charts.ts
  • frontend/src/utils/text.test.ts
  • frontend/src/utils/text.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath

Copy link
Copy Markdown
Owner Author

Closing as a duplicate: this branch's work (the code-scanning 4 and 5 sanitizer fix) already merged as #119 -- the branch was never deleted after the squash, so the 02:04 branch sweep opened it again against a base it predates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant