Skip to content

Commit

Permalink
Merge pull request #313 from SocketDotTech/audit/soc2-8
Browse files Browse the repository at this point in the history
fix: move up exec params check
  • Loading branch information
arthcp authored Sep 7, 2023
2 parents 91d91ee + 365d2ab commit 592dca8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions contracts/socket/SocketDst.sol
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ abstract contract SocketDst is SocketBase {
.isExecutor(packedMessage, executionDetails_.signature);
if (!isValidExecutor) revert NotExecutor();

// finally make sure executor params were respected by the executor
executionManager__.verifyParams(
messageDetails_.executionParams,
msg.value
);

// verify message was part of the packet and
// authenticated by respective switchboard
_verify(
Expand All @@ -215,8 +221,7 @@ abstract contract SocketDst is SocketBase {
packedMessage,
packetRoot,
plugConfig,
executionDetails_.decapacitorProof,
messageDetails_.executionParams
executionDetails_.decapacitorProof
);

// execute message
Expand All @@ -240,8 +245,7 @@ abstract contract SocketDst is SocketBase {
bytes32 packedMessage_,
bytes32 packetRoot_,
PlugConfig memory plugConfig_,
bytes memory decapacitorProof_,
bytes32 executionParams_
bytes memory decapacitorProof_
) internal {
// NOTE: is the the first un-trusted call in the system, another one is Plug.inbound
if (
Expand All @@ -263,9 +267,6 @@ abstract contract SocketDst is SocketBase {
decapacitorProof_
)
) revert InvalidProof();

// finally make sure executor params were respected by the executor
executionManager__.verifyParams(executionParams_, msg.value);
}

/**
Expand Down

0 comments on commit 592dca8

Please sign in to comment.