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

x/pkgsite: XSS possible (?) by injecting HTML into Example output #46661

Closed
markuswustenberg opened this issue Jun 9, 2021 · 6 comments
Closed
Labels
FrozenDueToAge pkgsite/frontend Issues related to pkgsite HTML/CSS/JavaScript and frontend development pkgsite

Comments

@markuswustenberg
Copy link

What is the URL of the page with the issue?

https://pkg.go.dev/github.com/maragudk/gomponents#Attr

What is your user agent?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15

Screenshot

image

image

What did you do?

I'm building a library to render HTML. I have some examples in the test code, that render a string like <input required> (in the screenshot).

What did you expect to see?

I expected the example output to be <input required> (as a string). It is on the first screenshot, but press the Run button, and there is no string.

What did you see instead?

Instead, there's an HTML input field, which means that the output string isn't being properly escaped.

@gopherbot gopherbot added this to the Unreleased milestone Jun 9, 2021
@jamalc jamalc self-assigned this Jun 9, 2021
@jamalc jamalc modified the milestones: Unreleased, pkgsite/frontend Jun 9, 2021
@gopherbot
Copy link

Change https://golang.org/cl/326349 mentions this issue: content/static: escape example code output

@markuswustenberg
Copy link
Author

@jamalc cool with the quick turnaround time!

@jamalc
Copy link

jamalc commented Jun 9, 2021

@markuswustenberg, thank you for reporting!

@markuswustenberg
Copy link
Author

@jamalc, has this not been deployed yet? I'm still seeing the issue live on the site.

@jamalc
Copy link

jamalc commented Jun 10, 2021

We ran into an issue with our deploy yesterday. This fix is now live.

@markuswustenberg
Copy link
Author

Works perfectly. 😎

@hyangah hyangah added the pkgsite/frontend Issues related to pkgsite HTML/CSS/JavaScript and frontend development label May 20, 2022
@rsc rsc unassigned jamalc Jun 23, 2022
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge pkgsite/frontend Issues related to pkgsite HTML/CSS/JavaScript and frontend development pkgsite
Projects
None yet
Development

No branches or pull requests

4 participants