FS#4745 - Fix command handlers, and the command packet handler
Attached to Project:
OpenTTD
Opened by Matt D. (monoid) - Thursday, 25 August 2011, 15:16 GMT
Last edited by Remko Bijker (Rubidium) - Friday, 26 August 2011, 16:39 GMT
Opened by Matt D. (monoid) - Thursday, 25 August 2011, 15:16 GMT
Last edited by Remko Bijker (Rubidium) - Friday, 26 August 2011, 16:39 GMT
|
DetailsThis patch fixes issues in a few command handlers:
* CMD_SET_AUTOREPLACE: A group not owned by the current company can be added to the current company's autoreplace lists. This doesn't have any bad consequences, but is still an oversight in verification of the command parameters. * CMD_INSERT_ORDER: Conditional orders' variables and comparators have an off-by-one error in their verifications. This allows invalid orders to be inserted, leading to a NOT_REACHED in ProcessConditionalOrder. This is definitely exploitable. * CMD_DEPOT_SELL_ALL_VEHICLES: The sell_command is retrieved using GetCmdSellVeh on the user-provided vehicle_type before vehicle_type itself is verified. No real bad consequences, but this verification should be moved to before this. It also fixes an off-by-one error in the verification of the callback parameter in command packets. This doesn't have any bad consequences, as the usage of the parameter in looking up the _callback_table should not be entirely out-of-bounds, nor does the value retrieved get used by the server or any clients in a exploitable fashion. |
This task depends upon
Closed by Remko Bijker (Rubidium)
Friday, 26 August 2011, 16:39 GMT
Reason for closing: Fixed
Additional comments about closing: In r22845. Thanks for the patch
Friday, 26 August 2011, 16:39 GMT
Reason for closing: Fixed
Additional comments about closing: In r22845. Thanks for the patch
<michi_cc> Regarding the InsertOrder part of 4745, the problem itself is there since r12667 (i.e. the very first conditional order revision) even if the check in question was only added in r13752 (there wasn't any check before).
<michi_cc> So everything from 0.7.0 onwards is vulnerable. The lines in question weren't changed at all since r13752, so a single patch should apply to all revision.
<michi_cc> The wrong test for the callback is there since rForever (i.e. r942, merge network branch).