Repository navigation
Fixes 38683: Remove vulnerable Showdown Markdown dependency - #38684
shah-harshit wants to merge 1 commit into
Conversation
Code Review ✅ Approved 🟡 Medium riskReplacing Showdown with Marked changes Markdown rendering for feeds and service docs; parser differences could alter displayed content despite preserved sanitization. Replaces the Showdown Markdown runtime with Marked for feed, comment, and service-documentation rendering, and swaps the description emoji parser for a static 1,175-entry dictionary, then removes the VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
UI browser testsRan: all test files (openmetadata-ui/src/main/resources/ui/package.json affects every browser test) Result: ✅ 1072 passed · 154 skipped Changed code executed by these browser tests: 16 / 23 lines (70%)
|
Describe your changes:
Fixes #38683
Remove the remaining Showdown runtime uses and dependency. Feed/comment and service-documentation Markdown now use Marked behind the existing
MarkdownToHTMLConverter.makeHtmlAPI. Description emoji lookup now uses static data rather than invoking a second Markdown parser.Showdown 2.1.0 remains affected by GHSA-cr32-g25g-vxjj, GHSA-22g5-r2x5-97cx, and GHSA-rmmh-p597-ppvv; the current alerts list no patched version. This removes the package from the dependency graph. Alerts can clear after this lands on the default branch and dependency scanning processes it.
Follow-up to #38542 and #38663. No changes to backend APIs, schemas, ingestion, or submodule pointers.
Type of change:
High-level design:
showdown,@types/showdown, and their unreferenced Commander 9 lock entry. No packages are added and all other lock content stays unchanged. The dictionary avoids another runtime dependency and vocabulary drift.Tests:
Use cases covered
Feed nesting, paragraphs, line breaks, bold/emphasis/strikethrough, disabled task checkboxes, aligned tables, heading IDs and duplicate reset across documents, explicit links, unchanged bare URLs, mention HTML, literal code, unsafe link/event-handler sanitization, empty input, service-documentation sections/admonitions, and description emoji compatibility including inherited-property names.
Unit tests
Commit:
a437b0d3adf1a07b93486fc2eebb569507280408.10 suites passed, 291 tests passed, 0 failed using standard Jest setup with
--no-cache --runInBand --coverage, after physically removing the installed Showdown packages:src/utils/BlockEditorPureUtils.test.tssrc/utils/BlockEditorUtils.test.tssrc/utils/FeedUtilsPure.markdown.test.tssrc/utils/FeedUtils.test.tsxsrc/utils/FeedUtilsPure.buildMentionLink.test.tssrc/utils/FeedUtilsPure.getFeedCounts.test.tssrc/utils/ServiceUtils.test.tssrc/components/ActivityFeed/ActivityFeedCardNew/CommentCard.test.tsxsrc/components/ActivityFeed/ActivityFeedCard/FeedCardBody/FeedCardBodyNew.test.tsxsrc/components/common/CommentComposer/CommentComposer.test.tsxAfter selecting Marked's explicitly synchronous lexer/parser API, reran the six affected feed, documentation, and component suites: 83 passed, 0 failed. The four unchanged description/count/mention suites reuse the ten-suite evidence above.
git diff --checkpass on changed files.yarn list --pattern showdown --offline --ignore-enginessucceeds with no matches. Neither installed package resolves; no tracked manifest, lockfile, or runtime import references either dependency.Backend integration tests
Not applicable — no backend changes.
Ingestion integration tests
Not applicable — no ingestion changes.
Playwright (UI) tests
Not run locally for this OSS parser/dependency follow-up. Real DOM parser and component tests above cover affected behavior.
Manual testing performed
No new browser session. Validated rendered DOM outcomes, documentation markup, dependency removal, and exact emoji parity locally as listed above.
UI screen recording:
Not applicable — standalone security/dependency fix with no component, layout, styling, or theme changes. Existing task-list markup and alignment are preserved and checked in DOM tests.
Checklist:
REVIEW.mdata437b0d3adf1a07b93486fc2eebb569507280408: no blocking findings. Test map: description converter/dictionary toBlockEditorPureUtils.test.ts; feed converter toFeedUtilsPure.markdown.test.ts; documentation consumer toServiceUtils.test.ts.