| Auto-Submit | +1 |
PTAL, Igor (and keep in mind that I'm not super familiar with those sandbox stuff, so don't assume that I know what I'm doing 😭)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks! Overall looks good to me
shared.GetBytecodeArray(broker()).parameter_count_without_receiver();I think this code pattern is also not fully safe since the SFI is inside the sandbox so an attacker could make it reference different bytecode arrays (or does `GetBytecodeArray(broker())` load from a serialized version of the SFI?). I guess for this code here it doesn't really matter though since we're just creating/accessing more in-sandbox data, so corruption doesn't matter.
Might be worth noting in a comment or so though? Alternatively, the correct way to do it would be to fetch the bytecode array exactly once during compilation.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
shared.GetBytecodeArray(broker()).parameter_count_without_receiver();I think this code pattern is also not fully safe since the SFI is inside the sandbox so an attacker could make it reference different bytecode arrays (or does `GetBytecodeArray(broker())` load from a serialized version of the SFI?). I guess for this code here it doesn't really matter though since we're just creating/accessing more in-sandbox data, so corruption doesn't matter.
Might be worth noting in a comment or so though? Alternatively, the correct way to do it would be to fetch the bytecode array exactly once during compilation.
Can we use `state_info.parameter_count_without_receiver()` here and below too?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
PTAL again. Not fully fixed because I'm not getting the initial BytecodeArray from a trusted place, but this doesn't look trivial to do. Still, hopefully we're consistent w.r.t. the BytecodeArray that we initially get..
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
(moving Samuel to reviewers as well; 2 reviews are better than 1 :) )
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks!
bytecode_array_ = handle(shared->GetBytecodeArray(isolate), isolate);Where is this used? I think we will always have one place (basically the compiler entrypoint) where we do an untrusted load of a BytecodeArray from the JSFunction (or SFI) that we're compiling. But then all other accesses to the BytecodeArray should fetch it from a trusted location (e.g. from the OptimizedCompilationInfo).
shared.GetBytecodeArray(broker()).parameter_count_without_receiver();I guess this still reads from inside the sandbox (?) so maybe add a comment here that this is either safe or that it would be good to fix in the future?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |