In the continuous endeavor to ensure the security and robustness of blockchain systems, uncovering vulnerabilities remains a crucial aspect. A recent examination of the Socket DL revealed a potential exploit where colluded transmitters could bypass important validations. This post-mortem aims to dissect the identified vulnerability and suggest remediation strategies.
Links to codebase:
This vulnerability essentially permits colluded transmitters to run malicious commands on any plug connected to Socket DL, completely bypassing switchboard validations.
Switchboards impacted include FastSwitchBoard, but there are indications that other switchboards may be susceptible as well.
At its core, this vulnerability could cause messages to be corrupted during transit. The Decapacitor may then find itself unable to validate the said message. This has repercussions for applications built atop Socket's DL.
Proposal of PacketID: Start by proposing a random packetId
with a differing remoteSlug
. For instance, BSC (56) could be utilized on SocketDst.sol
.
Watcher Trip Path: As anticipated, watchers will trip the path, removing you as transmitters. This is consistent with expectations. However, if they trip the global path, further progression is impeded.
Execution After Timeout: Once the timeoutPeriod
surpasses the gap between the proposal time and the current block timestamp, you can invoke the execute()
function. This function can be utilized with a msgId
of your preference, corresponding with the random root proposed in the first step.
The loophole emerges as the transmitter can conveniently sidestep all validations. They simply need to introduce a random packetId
and await the timeoutPeriod
to elapse on the switchboard.
Primary Code Vulnerability: The absence of validation between the packetId's
source chain and the msg id's
chain is glaring. Moreover, the root is merely authenticated against the local state present on the socket contract.
Introduce Cross-Validation: Insert validation checks to corroborate that the packetId's
source chain and the msg id's
chain are consistent.
Direct Reading from Switchboard: Instead of relying solely on the local state, retrieve the root directly from the switchboard. This alteration can preclude bypassing the Decapacitor validations.
Additional Checks: Infuse further checks between the remoteSlug
in both packetId
and msgId
. Intensify timeout validations in the fast switchboard.
Identifying vulnerabilities is a crucial step in advancing the security of any system. It's imperative to not only unearth these vulnerabilities but also act upon them swiftly and decisively. The above assessment and suggestions are presented with the sole intention of fortifying Socket DL against potential threats.
Stay informed, stay secure.