-
Notifications
You must be signed in to change notification settings - Fork 409
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
Strange internal reference IDs in HTML #2803
Comments
Wow, that's bad. Thanks for noticing and reporting it, and especially thanks for the reproducer - I was able to find the cause very quickly.
Indeed, the problem was basically this: when(sealed) {
...
else -> sealed.toString()
} There was no branch for Since we're doing |
This could be a problem when the Kotlin name allows characters that are not valid HTML IDs, for example space. There should be some escaping. |
Describe the bug
<a id="..."
and<a name="..."
and<a href="..."
are containing weird values.Here's an example (yes, this whole thing is ONE
id
, except it's invalid because it contains quotes and they're not escaped):Expected behaviour
Short and valid references within the docs. Not exposing local file paths of the build machine / CI that creates the docs (it might be a security risk based on the threat model).
Screenshots
To Reproduce
gradlew dokkaJavadoc
common\build\dokka\javadoc\net\twisterrob\gradle\common\VariantTaskCreator.html
or inspectvariantConfig
method's link or anchor.Dokka configuration
Configuration of dokka used to reproduce the bug
Installation
Additional context
Looks like a deep
toString
of some DSL object, so it might be a trivial fix. Also note that the value is used raw without any HTML escaping, so it's generates invalid/unsafe HTML with easy injection point.The text was updated successfully, but these errors were encountered: