Submitted by MiloTruck
In the protocol, publications are uniquely identified through the publishers profile ID and the publications ID. For example, when a user calls act(), the publication being acted on is determined by publicationActedProfileId and publicationActedId:
ActionLib.sol#L23-L26
However, as publication IDs are not based on the publications data, this could cause users to act on the wrong publication in the event a blockchain re-org occurs.
For example:
In this scenario, due to the blockchain re-org, Bob calls act() on a different publication than the one he wanted. This could have severe impacts depending on the action module being called; if the action module is used to collect and pay fees to the publisher and referrals (eg. MultirecipientFeeCollectModule.sol), Bob could have lost funds.
Note that this also applies to comment(), mirror and quote(), as they can be called with reference modules with sensitive logic as well.
If a blockchain re-org occurs, users could potentially act/comment/mirror/quote on the wrong publication, which has varying impacts depending on the action or reference module being used, such as a loss of funds due to paying fees.
Given that Lens Protocol is deployed on Poylgon, which has experienced large re-orgs in the past, the likelihood of the scenario described above occuring due to a blockchain re-org is not low.
Consider identifying publications with a method that is dependent on its contents. For example, users could be expected to provide the keccak256 hash of a publications contents alongside its publication ID.
This would prevent users from acting on the wrong publication should a publications contents change despite having the same ID.
donosonaumczuk (Lens) disputed and commented:
Picodes (judge) commented:
donosonaumczuk (Lens) commented:
