-
Notifications
You must be signed in to change notification settings - Fork 329
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
Fix emitter states handling when write_indicator fails #290
Conversation
apparently some tests are failing, so there are cases where this is wrong... looking... edit: fixed syntax issue |
9e576d2
to
82d96d5
Compare
That's great. i think it is a more general fix for this. So can we merge it? |
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.
I'm not familiar with the code but as far as I can see this makes sense.
Probably the |
There are cases where yaml_emitter_write_indicator fails. In that case POP is called on emitter->indents but not on emitter->states, which results in a leftover event in the stack, and later POP is called on an empty emitter->indents stack. This commit does not fix the case of the failing yaml_emitter_write_indicator. This is still investigated.
82d96d5
to
ff577b9
Compare
I moved the |
I'm currently extremely busy but I'll try to review this soon. |
This is a high score cve, which has a great impact on the libyaml community. If possible, it is necessary to merge this pr as soon as possible. This is my humble opinion |
The CVSS score for this vulnerability says that the attack complexity is low and the attract vector is the network (which means almost anybody can use this vulnerability to attack a system via a network). From the discussions here, I have a very different feeling. Even the maintainers of the software itself have a hard time exploiting/reproducing the vulnerability. It's either easy to reproduce or the score and therefore the severity of the vulnerability is wrong. |
Note that the reproducers I found use the canonical mode, which is probably rarely used. But I think it could be possible to produce the same effect without canonical mode, and possibly someone already knows the necessary input for that. |
Please see my update that I don't consider it a vulnerability: #258 (comment) |
I agree with you. I don't think this is a cve either. but now does this PR still need to be merged? |
I think the PR an improvement, but I would rather try to check in yaml_emitter_close if the emitter is in an error state. probably I can just check if an error was set. |
I will create a different PR when I have time |
There are cases where
yaml_emitter_write_indicator
fails. In that case POP is called onemitter->indents
but not onemitter->states
, which results in a leftover event in the stack, and later POP is called on an emptyemitter->indents
stack.This commit does not fix the case of the failing
yaml_emitter_write_indicator
. This is still investigated.This will mitigate CVE-2024-3205