codeant-ai-for-open-source[bot] commented on code in PR #42214:
URL: https://github.com/apache/superset/pull/42214#discussion_r3609509090


##########
superset-frontend/packages/superset-ui-core/src/components/DesignSystem.stories.tsx:
##########
@@ -25,7 +25,7 @@ export default {
 
 export const DesignSystem = () => (
   <>
-    <Markdown>
+    <MarkdownToJsx>

Review Comment:
   **Suggestion:** Wrapping this markdown block in `MarkdownToJsx` now renders 
the embedded raw HTML anchor, which includes `target="_blank"` without 
`rel="noopener noreferrer"`. That introduces a reverse-tabnabbing risk in 
rendered docs/stories; update the rendered link markup (or markdown renderer 
overrides) so external blank-target links always include a safe `rel` value. 
[security]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Storybook design docs expose reverse-tabnabbing external link.
   - ⚠️ Potential account hijack via malicious external site.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. Start the Storybook dev server that loads stories from
   `superset-frontend/packages/superset-ui-core/src/components` (Storybook 
discovers
   `*.stories.tsx` files; this file defines a `default` export at lines 22-24 
naming the
   story "Design System/Introduction").
   
   2. In the Storybook UI, navigate to the "Design System/Introduction" story 
defined by
   `export default { title: 'Design System/Introduction' };` at
   
`superset-frontend/packages/superset-ui-core/src/components/DesignSystem.stories.tsx:22-24`.
   
   3. Observe that the `DesignSystem` story component at lines 26-42 wraps a 
markdown string
   in `<MarkdownToJsx>` (line 28) which includes raw HTML for an external link 
at lines
   36-38: `<a href="https://bradfrost.com/blog/post/atomic-web-design/"; 
target="_blank">Intro
   to Atomic Design</a>`.
   
   4. Using browser devtools on the rendered story, inspect the "Intro to 
Atomic Design" link
   and confirm the anchor is rendered with `target="_blank"` and no `rel` 
attribute; clicking
   it opens a new tab while preserving `window.opener`, enabling 
reverse-tabnabbing if the
   external site is compromised.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=270aa04f93ed4a55a549787a7473c23c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=270aa04f93ed4a55a549787a7473c23c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** 
superset-frontend/packages/superset-ui-core/src/components/DesignSystem.stories.tsx
   **Line:** 28:28
   **Comment:**
        *Security: Wrapping this markdown block in `MarkdownToJsx` now renders 
the embedded raw HTML anchor, which includes `target="_blank"` without 
`rel="noopener noreferrer"`. That introduces a reverse-tabnabbing risk in 
rendered docs/stories; update the rendered link markup (or markdown renderer 
overrides) so external blank-target links always include a safe `rel` value.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42214&comment_hash=003ceba85cd94e8d881b379050b5747f7a1067e5e646e5d456c234170552575c&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42214&comment_hash=003ceba85cd94e8d881b379050b5747f7a1067e5e646e5d456c234170552575c&reaction=dislike'>👎</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to