cxong / cdogs-sdl

Classic overhead run-and-gun game
https://cxong.github.io/cdogs-sdl/
GNU General Public License v2.0
868 stars 115 forks source link

CVE-apply:In Nanopb before versions 0.3.9.8 and 0.4.5, decoding a specifically formed message can cause invalid `free()` or `realloc()` calls if the message type contains an `oneof` field, and the `oneof` directly contains both a pointer field and a non-pointer field. #829

Closed hucarxiao closed 6 months ago

hucarxiao commented 6 months ago

Version latest

What is the security issue or vulnerability? /nanopb/pb_decode.c In Nanopb before versions 0.3.9.8 and 0.4.5, decoding a specifically formed message can cause invalid free() or realloc() calls if the message type contains an oneof field, and the oneof directly contains both a pointer field and a non-pointer field.

start from 1195 line: pb_release_single_field(&old_field);

Security issue or vulnerability information description: https://nvd.nist.gov/vuln/detail/CVE-2021-21401

commit:https://github.com/nanopb/nanopb/commit/e2f0ccf939d9f82931d085acb6df8e9a182a4261

Could you apply for another new CVE and fix it?

Fix invalid free() with oneof (https://github.com/nanopb/nanopb/issues/647) Nanopb would call free() or realloc() on an invalid (attacker controlled) pointer value when all the following conditions are true:

Depending on message layout, the bug may not be exploitable in all cases, but it is known to be exploitable at least with string and bytes fields. Actual security impact will also depend on the heap implementation used.

cxong commented 6 months ago

Thanks, I believe this is low priority. C-Dogs SDL uses fixed message types, and none contain the exact specific message format problem (oneof directly contains both a pointer field and a non-pointer field) so it is impossible for users to exploit this.