Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 1
    Any problem is only as important as the impact that it has on your users/stakeholders. But why just focus on vulnerabilities? what about the possibility that a legitimate user accidentally deletes the post because they made a mistake? The real issue here is understanding whether the problem being solved even matters in the first place; or whether it's important enough to warrant a computerised solution (any solution will have a cost somewhere), For example, it may be better to mitigate via a manual process such as restoring an accidentally deleted record from backup. Commented Feb 14, 2024 at 11:56
  • I believe TOCTOU problems where more common on older unix systems where some resources where shared, and developers where used to single user, single CPU systems. I think it should be much less of an issue for modern web applications that are designed with concurrency in mind. Commented Feb 14, 2024 at 14:52
  • 2
    This isn't a meaningful TOCTOU. Given a user who has admin privileges, and the privs have just been revoked, there is a brief window of a couple μs where the user is no longer admin but could still delete. But if that user had just requested the delete a tiny bit earlier, it would be allowed. The real-world impact of this is zero. Such race conditions are more relevant if you're acting on information from the resource, e.g. if (post.owner == user) delete(post). But that's easy to fix within a single SQL query, and also with some NoSQL systems. Only atomicity required, no serializability. Commented Feb 14, 2024 at 18:55
  • 1
    @JonasH I think you are thinking about this at a very micro level. TOCTOU issues can happen across many different scales of time. They are very relevant in distributed systems where transmission times create inherent gaps of millions of CPU cycles between TOC and TOU. Determining how long an access token or code should be valid is a common TOCTOU challenge in web application design. Commented Feb 14, 2024 at 19:21
  • @JimmyJames it can absolutely be an issue in all systems. But I still think modern systems and awareness have reduced the prevalence, at least in the sense of obscure coding bugs causing vulnerabilities. And you absolutely have to be aware of usability/security tradeoffs like access token validity time, but that should at least be a fairly visible issue. Commented Feb 15, 2024 at 7:44