-
-
Notifications
You must be signed in to change notification settings - Fork 489
fix: remove setting unsafe innerHTML
#2064
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
Merged
Conversation
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
As it is vulnerable to stored Cross-Site Scripting. Ref: PNX-3669 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
@kittaakos
kittaakos
added
topic: code
Related to content of the project itself
topic: security
Related to the protection of user data
type: imperfection
Perceived defect in any part of project
labels
May 11, 2023
rhpco
rhpco
approved these changes
May 11, 2023
@@ -95,6 +95,22 @@ export class LibraryListWidget extends ListWidget<
item.name,
version
);
const segments = splitByBoldTag(textContent);
if (!segments) {
message.textContent = textContent;
@rhpco
rhpco
May 11, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!
per1234
per1234
approved these changes
May 15, 2023
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.
Uh oh!
There was an error while loading. Please reload this page.
Motivation
Setting the
innerHTML
in an unsafe way has been removed, as it is vulnerable to stored Cross-Site Scripting.Change description
I have replaced the
innerHTML
with a series of<span>
elements optionally containing a<b>
child. Neither functional nor style changes are expected in IDE2.
Screen Shot 2023年05月11日 at 14 51 452.1.0
look and feel vs. the build from this PR:
Screen Shot 2023年05月11日 at 14 52 362.1.0
DOM:DOM from this PR:
Screen Shot 2023年05月11日 at 14 53 41Steps to verify:
ArduinoIoTCloud
library installed, uninstall it,ArduinoIoTCloud
library,2.1.0
release. They should be the same.Other information
Ref: PNX-3669
Reviewer checklist