fix(console): message formatting XSS vulnerability#2247
Open
jwueller wants to merge 1 commit intomainsail-crew:developfrom
Open
fix(console): message formatting XSS vulnerability#2247jwueller wants to merge 1 commit intomainsail-crew:developfrom
jwueller wants to merge 1 commit intomainsail-crew:developfrom
Conversation
ff18ae9 to
61b90a0
Compare
Having HTML characters like `<` in a message will currently break it's
rendering. An example would be a standard Python object `__repr__`,
like it might show up in an error message:
<klippy.extras.gcode_macro.GetStatusWrapperPython object at 0x7f67eb2cd0>
This is an XSS vulnerability. By making Klippy `M118` a message
containing HTML, you could hijack the browser of everyone currently
monitoring the console.
But even if you consider this an unlikely attack vector, this will
still fix quirky visual behavior in current message rendering, though.
61b90a0 to
8412813
Compare
Member
|
@jwueller Thank you very much! Pls also add an option in the Interface Settings to disable this feature/fix? Some projects like AFC-Klipper-Add-On or HappyHare use this for "HTML-Outputs". I would enable the escape per default, but users which use plugins like these, can disable it for "better format html outputs". |
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
Having HTML characters like
<in a message will currently break it's rendering. An example would be a standard Python object__repr__, like it might show up in an error message:This is an XSS vulnerability. Making Klippy echo a message containing HTML could run arbitrary code in the browser of everyone currently monitoring the console.
But even if you consider this an unlikely attack vector, this will still fix quirky visual behavior in current message rendering, though.
Related Tickets & Documents
None as far as I can tell, but I can create one for this vulnerability, if required.