track-turns doesn't guard against overridden .catch method #1244
Labels
confinement
Pertaining to confinement of guest programs.
endo
kriskowal-review-2024-01
Issues that kriskowal wants to bring to the attention of the team for review as of January, 2024
@erights and I were investigating a potential object-retention problem with the track-turns implementation, when we noticed that the following line:
endo/packages/eventual-send/src/track-turns.js
Line 81 in 1895f5b
would be vulnerable to the wrapped function's return value being a real
Promise
but whose.catch
method had been overridden. I haven't tried to build an exploit, but I think it would look something like this:The track-turns mechanism is supposed to be invisible to user code, but the fake
catch
would get to see the track-turns internal function that adds a rejection note to any error it emits.I'm guessing the way to fix this would be to replace the
Promise.resolve(result).catch(..)
with anE.when(result).catch(..)
, but I'm not positive.cc @erights @michaelfig
The text was updated successfully, but these errors were encountered: