News for hackers. Stuff that matters.
Re:I turned my ThinkPad into a programmable USB device by zrail on Thursday February 22, 2024 @05:30PM (#39474225)
Nice. This is a class of error with the delightful acronym TOCTOU (Time of Check to Time of Use) which is present in an astonishing number of places.

https://en.m.wikipedia.org/wiki/Time-of-check_to_time-of-use

Re:I turned my ThinkPad into a programmable USB device by hypercube33 on Thursday February 22, 2024 @07:12PM (#39475181)
Correct me if I'm wrong but I think that's how Gameboy carts show custom logos bypassing the Nintendo copyright check thing - one logo to pass the internal check and another for display.
Re:I turned my ThinkPad into a programmable USB device by TeMPOraL on Thursday February 22, 2024 @07:01PM (#39475099)
No surprise, those are near-impossible to avoid. I mean, a simple:

  if(check(resource)) {
    use(resource);
  }
is already vulnerable, unless you somehow make the entire piece of code run atomically.
Re:I turned my ThinkPad into a programmable USB device by X-Cubed on Thursday February 22, 2024 @07:41PM (#39475412)
One approach is to copy the data to a location that you control first (eg: RAM) and perform both the check and the use of that data from the trusted location. That can be difficult though on embedded devices with constrained resources.
Re:I turned my ThinkPad into a programmable USB device by crtasm on Thursday February 22, 2024 @07:36PM (#39475365)
For a firmware update: read it into memory or copy it to storage you control first.