You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we parse an attribute like <test =foo=bar/> Then in the DOM the attribute appears with the = sign, but when re-serialized it is generated without.
Code:
val doc = Jsoup.parse("<test =foo=\"bar\"/>")
for (elem in doc.select("test")) {
for (attr in elem.attributes()) {
println(attr.key)
}
}
println(doc.html())
This is problematic as if an application is doing validation on the key, to prevent XSS attacks, this can be a way to bypass the validation. I discovered this issue (in a lab environment, not a live app) just now.
The key for output can be accessed using getValidKey(). A potential solution to this is to normalise keys during parsing.
The text was updated successfully, but these errors were encountered:
If we parse an attribute like
<test =foo=bar/>
Then in the DOM the attribute appears with the = sign, but when re-serialized it is generated without.Code:
Output:
This is problematic as if an application is doing validation on the key, to prevent XSS attacks, this can be a way to bypass the validation. I discovered this issue (in a lab environment, not a live app) just now.
The key for output can be accessed using
getValidKey()
. A potential solution to this is to normalise keys during parsing.The text was updated successfully, but these errors were encountered: