security: anchor tag safety#4789
Merged
Merged
Conversation
|
Does anchor tag safety also means ignoring hrefs with non standard port. You can quick check by adding |
Contributor
Author
|
@ganeshgore it does, currently we only allow http/https. please open a feature request if you'd like to have support for |
17 tasks
bajtos
added a commit
to bajtos/swagger-ui
that referenced
this pull request
Jun 21, 2019
Setting target="_blank" on anchor tags is unsafe unless used in conjunction with rel="noopener". This is a back-port of dd3afdc (swagger-api#4789) to fix the problem in version 2.x. Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
This was referenced Jan 12, 2021
Closed
Closed
1 task
This was referenced May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Setting
target="_blank"on anchor tags is unsafe unless used in conjunction withrel="noopener".This PR fixes our internal usage, adapts our Markdown parser to protect against from vulnerable user input, and adds a linter rule to prevent future introductions of this vulnerability into Swagger UI.
Motivation and Context
Fixes an issue reported through our disclosure channel (email, security@swagger.io).
How Has This Been Tested?
XSS tests have been extended to cover these changes.
Checklist
My PR contains...
src/is unmodified: changes to documentation, CI, metadata, etc.)package.json)My changes...
Documentation
Automated tests