Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prb-math v3.3.2 not audited and contains some errors. #6

Closed
code423n4 opened this issue Jul 8, 2023 · 2 comments
Closed

prb-math v3.3.2 not audited and contains some errors. #6

code423n4 opened this issue Jul 8, 2023 · 2 comments
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate-423 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/PaulRBerg/prb-math/blob/1edf08dd73eb1ace0042459ba719b8ea4a55c0e0/package.json#L1-L4

Vulnerability details

Impact

The library prb-math v3.3.2 documents that it is not audited by a security researcher. This means its more risky to rely on this library.

Proof of Concept

{
  "name": "@prb/math",
  "description": "Solidity library for advanced fixed-point math",
  "version": "3.3.2",

prb-math v3.3.2 is being used.

While I set a high bar for code quality and test coverage, you should not assume that this project is completely safe to use. PRBMath has not yet been audited by a third-party security researcher.

prb-math v3.3.2 not audited
Some issues:

File: prb-math/src/Common.sol
413:        if (x & 0xFF00000000 > 0) {
440:        if (x & 0xFF00000000 > 0) {

The bit masks used on Line 413 and Line 440 in Common.sol are the same, i.e. 0xFF00000000. The latter should have two fewer zeroes.

Tools Used

Manual Review

Recommended Mitigation Steps

  • Current use of prb-math v3.3.2 may break the project's computational protocols
  • According to docs prb-math will add a new directory "audits" with PDF references to the audits performed by Cantina.
  • Consider redeploying prb-math V4 after being audited.

Assessed type

Math

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Jul 8, 2023
code423n4 added a commit that referenced this issue Jul 8, 2023
@c4-judge
Copy link
Contributor

Picodes marked the issue as duplicate of #423

@c4-judge
Copy link
Contributor

c4-judge commented Aug 5, 2023

Picodes marked the issue as satisfactory

@c4-judge c4-judge added satisfactory satisfies C4 submission criteria; eligible for awards duplicate-423 and removed duplicate-395 labels Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working duplicate-423 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

2 participants