Rock Paper Scissors

First Flight #38
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Floating Pragma Allows Unexpected Compiler Behavior

Summary

The contract uses a floating Solidity version pragma:

pragma solidity ^0.8.13;

Using ^0.8.13 allows automatic updates to newer Solidity versions (e.g., 0.8.14, 0.8.15), which can lead to unintended changes in contract behavior. This introduces risks related to version compatibility, unexpected behavior, and difficulty in debugging.

Vulnerability Details

  • Unintended Compiler Updates: ^0.8.13 allows updates to newer minor versions, which could introduce breaking changes or alter contract behavior.

  • Lack of Control: The contract may compile with a different version than expected, causing inconsistent behavior across environments.

  • Dependency and Upgradability Issues: Other dependencies might break, and future upgrades may become harder to manage.

Impact

While no immediate functionality or security issues arise, the contract becomes susceptible to unpredictable changes due to compiler updates, making debugging and testing more challenging.

Recommendations

Lock the Solidity version to exactly 0.8.13 to ensure consistent behavior:

- pragma solidity ^0.8.13;
+ pragma solidity 0.8.13;
Updates

Appeal created

m3dython Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational

Code suggestions or observations that do not pose a direct security risk.

Floating Pragma

m3dython Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational

Code suggestions or observations that do not pose a direct security risk.

Floating Pragma

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.