-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat: allow to set a maximum amount of aliases while parsing to protect against billion laughs attack and similar #620
Conversation
8069df6
to
5ea64d0
Compare
In the current code of the PR the cumulated alias weight of all nodes so far is used as a criterion. |
Is this necessary? |
Yes, this is definitely necessary. If you set If you need them and thus set it to With this protection, the DoS attack is prevented. It is a similar protection e.g. snakeyaml has built in if you use the high-level API (you use the low-level one), or also the YAML NPM package. |
If you have a better idea for a protection, your welcome to not merge this and do that other idea instead of course. :-) |
src/commonMain/kotlin/com/charleskorn/kaml/YamlConfiguration.kt
Outdated
Show resolved
Hide resolved
64513da
to
ba60015
Compare
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.
Two small suggestions, and then I think this is good to go!
src/commonMain/kotlin/com/charleskorn/kaml/YamlConfiguration.kt
Outdated
Show resolved
Hide resolved
ba60015
to
c60924f
Compare
src/commonMain/kotlin/com/charleskorn/kaml/YamlConfiguration.kt
Outdated
Show resolved
Hide resolved
@Vampire could you please fix the linting failure? |
…inst billion laughs attack and similar
276f17e
to
7211388
Compare
Whoops, sorry, did the uglification now. :-) |
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.
Thanks @Vampire!
🎉 This PR is included in version 0.64.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.