If there is ever a hardfork for Beanstalk then EIP712_TYPE_HASH
value will become invalid. This is because the chainId parameter is hardcoded.
L2ContractMigrationFacet.sol
LibTractor.sol:
This means even after a hard fork chainId
would remain the same which is incorrect and could cause possible replay attacks.
For reference, here are findings reporting the same problem:
High - https://solodit.xyz/issues/lack-of-chainid-validation-allows-reuse-of-signatures-across-forks-trailofbits-advanced-blockchain-pdf
Medium - https://code4rena.com/reports/2022-07-golom#m-05-replay-attack-in-case-of-hard-fork
Manual Review
The EIP712_TYPE_HASH
variable should be recomputed everytime by placing current value of chainId. Therefore use block.chainid
instead of the hardcoded chain id.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.