Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unsafe use of jQuery .html() #1382

Merged
merged 1 commit into from Oct 29, 2022
Merged

Fix unsafe use of jQuery .html() #1382

merged 1 commit into from Oct 29, 2022

Conversation

l2dy
Copy link
Contributor

@l2dy l2dy commented Apr 4, 2022

.html() can introudce cross-site-scripting (XSS) vulnerabilities with strings from untrusted sources. Use .text() instead or sanitize the input.

@l2dy
Copy link
Contributor Author

l2dy commented Oct 29, 2022

@joyqi Anything else I need to do to get this merged?

@joyqi
Copy link
Member

joyqi commented Oct 29, 2022

Hi @l2dy , I'm always considering adding XSS protection to editor preview, but I'm not sure if it's necessary.
If someone has the access to the admin panel, he can do anything, including adding XSS code to the database.

@l2dy
Copy link
Contributor Author

l2dy commented Oct 29, 2022

An attacker does not have to gain access to the admin panel to exploit this. It's a stored XSS attack that works if an admin tries to edit a malicious comment, allowing the attacker to inject arbitrary code into the admin panel.

@joyqi
Copy link
Member

joyqi commented Oct 29, 2022

You're right, at least we need XSS protection for comments.

@joyqi joyqi merged commit 8437eac into typecho:master Oct 29, 2022
@l2dy l2dy deleted the xss-fix branch October 29, 2022 16:57
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.

None yet

2 participants