|
|
|
|
|
by AaronFriel
1393 days ago
|
|
Despite the "How Safe is Zig"[1] blog post, it's false that there is a spectrum. A lack of temporal safety implies a lack of spatial safety, and vice versa. If one can use a use-after-free, invalid write, time of check-time of use error to write a byte to an invalid location, the program's data structures are now in an inconsistent state, violating invariants required for "spatial safety" such as objects being the correct type, buffers and lengths being paired together correctly, etc. Likewise, if one can accomplish a buffer overflow, a spatial safety violation, or an out of bounds write, then by definition they've made temporal violations as well. Writing objects out of bounds or arbitrary heap writes imply data races. Offensive security folks use gadgets that exploit one to accomplish the other, as needed. [1] https://www.scattered-thoughts.net/writing/how-safe-is-zig/ |
|
Does it follow that the fact that temporal violations could be used to violate runtime spatial checks, therefore means that spatial safety in itself is entirely without value?
What are your thoughts also on buffer underflows? I ask since I take it you also work on offensive security.