Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 25, 2023. It is now read-only.

sanitize article content to fix stored xss#2

Open
gtsp233 wants to merge 1 commit into
dunizb:master from
gtsp233:fix-xss
Open

sanitize article content to fix stored xss #2
gtsp233 wants to merge 1 commit into
dunizb:master from
gtsp233:fix-xss

Conversation

@gtsp233

@gtsp233 gtsp233 commented Dec 1, 2023
edited
Loading

Copy link
Copy Markdown

Hi, I've discovered a stored Cross-Site Scripting (XSS) vulnerability in the projects/react_blog:

Vulnerability Details:
Version Affected: All versions
Severity: [High/Critical – Stored XSS can have a significant impact. Adjust based on your assessment]
Description: The vulnerability allows malicious attacks to inject scripts through a direct network request. Once embedded, any user's browser viewing the article will execute the malicious script

Steps to Reproduce:
Send a direct POST request (bypassing the user interface) to /addArticle with payload content containing the malicious script.
After the article is successfully created or edited, any user's browser that views the article will run the malicious script.

Suggested Fix or Mitigation:
Server-side: When creating the article, it's essential to sanitize the user's input (content) before processing it to ensure malicious scripts are neutralized.
Client-side: Before displaying the article's content using dangerouslySetInnerHtml, ensure that the description is sanitized using libraries like DOMPurify to prevent script execution.

I've already fixed and tested this issue, and have submitted a pull request with the necessary changes. Please review and merge my pull request at your earliest convenience to resolve this vulnerability. Thanks!

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /