Time-of-check to time-of-use: Difference between revisions

Content deleted Content added
Updated incorrect grammar.
No edit summary
Line 38:
| date=28 May 2019
| publisher=Duo Security
| access-date=2019-05-29}}</ref> In the 2023 [[Pwn2Own]] competition in Vancouver, a team of hackers were able to compromise the gateway in an updated [[Tesla modelModel 3]] using this bug.<ref>{{Cite web |title=Windows 11, Tesla, Ubuntu, and macOS hacked at Pwn2Own 2023 |url=https://www.bleepingcomputer.com/news/security/windows-11-tesla-ubuntu-and-macos-hacked-at-pwn2own-2023/ |access-date=2023-03-24 |website=BleepingComputer |language=en-us}}</ref>
 
== Examples ==
Line 129:
== Preventing TOCTOU ==
 
Despite conceptual simplicity, TOCTOU race conditions are difficult to avoid and eliminate. One general technique is to use error handling instead of pre-checking, under the philosophy of EAFP – "It is easier to ask for forgiveness than permission" {{snd}}rather than LBYL – "look before you leap". – inIn this case there is no check, and failure of assumptions to hold are signaled by an error being returned.<ref>{{cite book
| last=Martelli
| first=Alex