How can I resolve the vulnerability in JSTree's get_node flagged by Checkmarx? #2780
Unanswered
jportilloa
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In Checkmarx, this vulnerability is flagged as follows: "The method function embeds untrusted data in generated output with jQuery, at line 962 of jstree. This untrusted data is embedded into the output without proper sanitization or encoding, enabling an attacker to inject malicious code into the generated web-page." This vulnerability arises from the following code:
And also this:
These snippets reference the following code:
$('#' + obj.replace($.jstree.idregex,'\\$&'), this.element)
And this:
$('#' + obj.id.replace($.jstree.idregex,'\\$&'), this.element)
I received a response from one of Vakata's team members, who provided this answer: issues. However, after making those changes, replacing $(...) with this.element.querySelector(...), JSTree stopped functioning properly.
Beta Was this translation helpful? Give feedback.
All reactions