-
Notifications
You must be signed in to change notification settings - Fork 513
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
Account directive use-after-free vulnerability with deferred postings (TALOS-2017-0304, CVE-2017-2808) #1723
Comments
|
Test case (slightly modified from Cory's):
|
The background on these deferred postings is here: https://groups.google.com/forum/#!topic/ledger-cli/ooxbPVRinSs |
I don't think the analysis in the CVE report is complete. To me it looks like the bug happens because the 'all null' transaction is discarded: Lines 407 to 408 in 53f4035
But right before that, in the loop checking for not-null posts, the deferred post is added to a map on the account containing deferred postings. It's when this map is read in account_t::apply_deferred_posts() that the use-after-free happens because the all-null transaction has been freed.Lines 398 to 399 in 53f4035
Lines 155 to 168 in 53f4035
Could a fix be to change |
All-null transactions are discarded and thus freed, but with a deferred posting this results in a use-after-free error when the deferred postings are applied. Ignore null deferred postings to prevent this. Fixes ledger#1723
All-null transactions (i.e. a transaction where all postings have a null amount) are discarded during parsing and the `xact` object is free'd. But if the transaction contains a deferred posting this results in a use-after-free vulnerability because a reference to the deferred posting is stored in the account object which is later read when deferred postings are applied after parsing is finished. Ignore null deferred postings to prevent this – they should not have any effect any way. Thanks to Cory Duplantis for reporting this issue and providing an initial analysis. Ref TALOS-2017-0304, CVE-2017-2808 Fixes ledger#1723
All-null transactions (i.e. a transaction where all postings have a null amount) are discarded during parsing and the `xact` object is free'd. But if the transaction contains a deferred posting this results in a use-after-free vulnerability because a reference to the deferred posting is stored in the account object which is later read when deferred postings are applied after parsing is finished. Ignore null deferred postings to prevent this – they should not have any effect any way. Thanks to Cory Duplantis for reporting this issue and providing an initial analysis. Ref TALOS-2017-0304, CVE-2017-2808 Fixes ledger#1723
All-null transactions (i.e. a transaction where all postings have a null amount) are discarded during parsing and the `xact` object is free'd. But if the transaction contains a deferred posting this results in a use-after-free vulnerability because a reference to the deferred posting is stored in the account object which is later read when deferred postings are applied after parsing is finished. Ignore null deferred postings to prevent this – they should not have any effect any way. Thanks to Cory Duplantis for reporting this issue and providing an initial analysis. Ref TALOS-2017-0304, CVE-2017-2808 Fixes ledger#1723
All-null transactions (i.e. a transaction where all postings have a null amount) are discarded during parsing and the `xact` object is free'd. But if the transaction contains a deferred posting this results in a use-after-free vulnerability because a reference to the deferred posting is stored in the account object which is later read when deferred postings are applied after parsing is finished. Ignore null deferred postings to prevent this – they should not have any effect any way. Thanks to Cory Duplantis for reporting this issue and providing an initial analysis. Ref TALOS-2017-0304, CVE-2017-2808 Fixes ledger#1723
Cory Duplantis and another member of Cisco Talos discovered and described an issue with ledger:
CVE-2017-2808 was assigned.
The text was updated successfully, but these errors were encountered: