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

XSS injection #7472

Closed
outdoteth opened this issue Aug 25, 2021 · 10 comments
Closed

XSS injection #7472

outdoteth opened this issue Aug 25, 2021 · 10 comments
Assignees

Comments

@outdoteth
Copy link

outdoteth commented Aug 25, 2021

As per this issue here: #3847

You can do an XSS injection by adding the url parameter:
https://petstore.swagger.io/
https://petstore.swagger.io/?url=https://25.rs/expswagger587112/card.yaml

I've found several other issues reporting the same thing e.g. here: https://github.com/tarantula-team/CSS-injection-in-Swagger-UI

But it says they have been closed. So is this issue fixed or not? If so, how can we get the fix?

@char0n
Copy link
Member

char0n commented Aug 27, 2021

Refs #7433

@pkoziol
Copy link

pkoziol commented Sep 22, 2021

Yeah, it would be nice to be able to disable any parsing of query string and just use whatever was configured via code. Then I could host Swagger UI publicly.

I see that there is such suggestion already in #4872

@char0n
Copy link
Member

char0n commented Sep 24, 2021

FYI: as per suggestion in #4872 we have #7341 - breaking change release in progress; so maybe it's a good platform to introduce enableQueryConfig

But it says they have been closed. So is this issue fixed or not? If so, how can we get the fix?

For the case of https://github.com/tarantula-team/CSS-injection-in-Swagger-UI - this is fixed in SwaggerUI (style tag is forbidden and sanitized by markdown sanitizer)

https://petstore.swagger.io/?url=https://25.rs/expswagger587112/card.yaml

For this case I don't see any XSS exploit here. Basically we just render markdown code in safe way and stripping everything possibly malicious out (like form tag)

Generally, what you describe I'd say is a non-issue in current version of SwaggerUI.

@alegmal
Copy link

alegmal commented Nov 7, 2021

https://petstore.swagger.io/?url=https://25.rs/expswagger587112/card.yaml
do you mean that this example specifically is not an issue? or that "?url=" param is not an issue?

this is just an example and as described in #4872, you can pass potentially dangerous code using "?url=". for example, one that mimics api but sends requests with sensitive information to attacker controlled server.

or am I misunderstanding something?

@dinvlad
Copy link

dinvlad commented Nov 7, 2021

@alegmal you're onto something that we believe is a real issue. We're about to disclose it responsibly via [email protected]. If possible, let's continue the convo there!

@char0n
Copy link
Member

char0n commented Nov 8, 2021

@alegmal,

Yes I mean this example specifically is not an issue: https://25.rs/expswagger587112/card.yaml

I'll reiterate what I've said in previous comment:

For this case I don't see any XSS exploit here. Basically we just render markdown code in safe way and stripping everything possibly malicious out (like form tag)

@jluque0101
Copy link

@dinvlad I'd like to follow up progress on this, is there any other place where I could check for updates?
Thanks

@dinvlad
Copy link

dinvlad commented Nov 17, 2021

@jluque0101 we've connected with the Swagger team, but I'm not sure if we're ready to disclose anything yet. Waiting on their response.

@runkalicious
Copy link

@jluque0101 Please see the Security Advisory regarding this: GHSA-qrmm-w75w-3wpx

@jluque0101
Copy link

Thanks @runkalicious !

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

No branches or pull requests

7 participants