1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00
Files
archived-php-src/ext
Niels Dossche e735d2bc3b Fix GH-17808: PharFileInfo refcount bug
PharFileInfo just takes a pointer from the manifest without refcounting
anything. If the entry is then removed from the manifest while the
PharFileInfo object still exists, we get a UAF.
We fix this by using the fp_refcount field. This is technically a
behaviour change as the unlinking is now blocked, and potentially file
modifications can be blocked as well. The alternative would be to have a
field that indicates whether deletion is blocked, but similar corruption
bugs may occur as well with file overwrites, so we increment fp_refcount
instead.
This also fixes an issue where a destructor called multiple times
resulted in a UAF as well, by moving the NULL'ing of the entry field out
of the if.

Closes GH-17811.
2025-02-15 13:15:51 +01:00
..
2025-02-05 19:22:51 +01:00
2025-01-17 11:53:10 +00:00
2024-10-13 21:12:46 +02:00
2024-12-18 11:38:44 +00:00
2024-11-27 19:54:06 +00:00
2024-11-10 20:16:33 +00:00
2025-02-02 13:37:21 +01:00
2024-08-06 16:54:58 +02:00
2024-10-03 21:11:25 +02:00
2024-06-28 20:14:20 +02:00
2025-02-14 23:09:57 +01:00