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

Audit: fix low severity issues #874

Closed
13 tasks done
rndquu opened this issue Jan 18, 2024 · 20 comments
Closed
13 tasks done

Audit: fix low severity issues #874

rndquu opened this issue Jan 18, 2024 · 20 comments

Comments

@rndquu
Copy link
Member

rndquu commented Jan 18, 2024

There are a bunch of low severity issues caught by auditors which are nice to fix. This is a low priority issue.

P.S. The list may be updated

@0x4007
Copy link
Member

0x4007 commented Jan 19, 2024

Just to clarify @gitcoindev @molecula451 because of:

P.S. The list may be updated

I think it makes sense to:

  1. Reopen those issues on the Sherlock repository 1
  2. Open pull requests to @ubiquity/ubiquity-dollar and write something like Resolves https://github.com/sherlock-audit/2023-12-ubiquity-judging/issues/21 in the pull request body 2

This is to keep things in sync. After our adjustments are completed, we can mirror the issues back to the @ubiquity/ubiquity-dollar repository as a backup for auditing purposes (in case Sherlock decides to delete their repository.)

You guys should delete the mirrored issues on this repository now.

Footnotes

  1. It is not clear to me why Sherlock closes them as complete. I suppose we technically can leave them closed as complete and still associate pull requests to them if it is a problem to reopen them.

  2. This automatically associates the issue with the pull request, which is useful for auditing in the future.

@0x4007 0x4007 pinned this issue Jan 19, 2024
@0x4007 0x4007 mentioned this issue Jan 19, 2024
@molecula451
Copy link
Member

Yeah, i think it makes sense, all the mirroed issues were taken down, point to PR to resolve to the Resolves https://github.com/sherlock-audit/2023-12-ubiquity-judging/issues/X number issue

@rndquu
Copy link
Member Author

rndquu commented Jan 19, 2024

Reopen those issues on the Sherlock repository

I don't think we should reopen them since those closed issues are considered invalid/low priority in terms of sherlock rules so the medium/high issues are only opened.

@gitcoindev
Copy link
Contributor

Reopen those issues on the Sherlock repository

I don't think we should reopen them since those closed issues are considered invalid/low priority in terms of sherlock rules so the medium/high issues are only opened.

Cross-referencing them is a good practice. I am also not sure if Sherlock will keep this available forever, so we can mirror the issues back as @pavlovcik suggested, and skip reopening.

@molecula451
Copy link
Member

molecula451 commented Jan 19, 2024

By the sherklock repo it looks like they "archive" the whole judging repo, so i think we're fine with either way, mirroring now or mirroring later

@molecula451
Copy link
Member

Recapping this one this issue posted here were closed specifically by the lead judge, i reopened one (to recheck) and he gave a reason to re-closed

@gitcoindev
Copy link
Contributor

I am going to look into those issues and try to gradually fix them one by one starting tomorrow onward.

@0x4007
Copy link
Member

0x4007 commented Jan 31, 2024

I should be able to enable payouts directly in their repository once I make time to figure out the permit wallet situation.

@rndquu
Copy link
Member Author

rndquu commented Feb 1, 2024

Update - this issue was marked invalid by Sherlock team

If some issue is marked as invalid by the Sherlock team it doesn't mean that we shouldn't fix it. Sherlock has pretty strict rules so only medium and high severity issues are considered valid hence the current "Audit: fix low severity issues" task was created specifically for low severity issues.

@gitcoindev
Copy link
Contributor

Update - this issue was marked invalid by Sherlock team

If some issue is marked as invalid by the Sherlock team it doesn't mean that we shouldn't fix it. Sherlock has pretty strict rules so only medium and high severity issues are considered valid hence the current "Audit: fix low severity issues" task was created specifically for low severity issues.

All right, thank you for clarifying this, I update the description.

@molecula451
Copy link
Member

molecula451 commented Feb 28, 2024

rndqnuu the diamond it's not subceptible to reentraacy, i've seen others implementation live and they are working very well so sherlock-audit/2023-12-ubiquity-judging#119 not need to be overlook

@rndquu
Copy link
Member Author

rndquu commented Feb 28, 2024

rndqnuu the diamond it's not subceptible to reentraacy, i've seen others implementation live and they are working very well so sherlock-audit/2023-12-ubiquity-judging#119 not need to be overlook

I don't think so, diamond does susceptible to reentrancy. Could you share some articles where it is stated that diamond is "reentrancy free"?

@molecula451
Copy link
Member

molecula451 commented Feb 28, 2024

I don't think so, diamond does susceptible to reentrancy. Could you share some articles where it is stated that diamond is "reentrancy free"?

in the fallback function where this watson pointed that it's prone to reentrant, doesn't look like, basically he's poiting that we lack the nonReetrant here on the fallback

https://etherscan.io/address/0x32400084c286cf3e17e7b677ea9583e60a000324#code

for instance there is this diamond with a couple$ without this modifier, looks highly debuggged, you'd jack that pot if you reentrant the fallback there

and to me this submission was from an automated tool without manually check after so it looks as false positive

no modifier on the fallback deployed on chain either: https://github.com/aavegotchi/aavegotchi-contracts/blob/7db9b732466f9b6e9b22d669f313f495750935b1/contracts/Aavegotchi/ForgeDiamond/ForgeDiamond.sol#L30

@rndquu
Copy link
Member Author

rndquu commented Feb 29, 2024

I don't think so, diamond does susceptible to reentrancy. Could you share some articles where it is stated that diamond is "reentrancy free"?

in the fallback function where this watson pointed that it's prone to reentrant, doesn't look like, basically he's poiting that we lack the nonReetrant here on the fallback

https://etherscan.io/address/0x32400084c286cf3e17e7b677ea9583e60a000324#code

for instance there is this diamond with a couple$ without this modifier, looks highly debuggged, you'd jack that pot if you reentrant the fallback there

and to me this submission was from an automated tool without manually check after so it looks as false positive

no modifier on the fallback deployed on chain either: https://github.com/aavegotchi/aavegotchi-contracts/blob/7db9b732466f9b6e9b22d669f313f495750935b1/contracts/Aavegotchi/ForgeDiamond/ForgeDiamond.sol#L30

As a part of sherlock-audit/2023-12-ubiquity-judging#119 we don't need to add the nonReentrant modifier to the diamond's fallback but rather check all facets for this missing modifier (here, here, etc...)

@rndquu
Copy link
Member Author

rndquu commented Mar 1, 2024

@gitcoindev Why did you mark sherlock-audit/2023-12-ubiquity-judging#71 as invalid? Don't we need the whenNotPaused() modifier here, here or here?

@gitcoindev
Copy link
Contributor

@gitcoindev Why did you mark sherlock-audit/2023-12-ubiquity-judging#71 as invalid? Don't we need the whenNotPaused() modifier here, here or here?

Hi @rndquu ! I was guided by this comment sherlock-audit/2023-12-ubiquity-judging#71 (comment)

In the library we have already requires to protect against mint / redeem, for the examples that you provided:



My understanding was that this mechanism shall be used but theoretically, if you think it makes sense, we could add whenNotPaused() on top as well, please let me know, as adding the modifier is straightforward.

@molecula451
Copy link
Member

molecula451 commented Mar 1, 2024

yeah this would be code redundancy, let's re-check tests on this requires and if they're good then no need for whenNotPaused() modifier, avoid redundancy

@rndquu
Copy link
Member Author

rndquu commented Mar 4, 2024

@gitcoindev Why did you mark sherlock-audit/2023-12-ubiquity-judging#71 as invalid? Don't we need the whenNotPaused() modifier here, here or here?

Hi @rndquu ! I was guided by this comment sherlock-audit/2023-12-ubiquity-judging#71 (comment)

In the library we have already requires to protect against mint / redeem, for the examples that you provided:

My understanding was that this mechanism shall be used but theoretically, if you think it makes sense, we could add whenNotPaused() on top as well, please let me know, as adding the modifier is straightforward.

Yes, you're right, I've totally forgotten that https://github.com/ubiquity/ubiquity-dollar/blob/development/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol has its own pause mechanic. It's ok then to mark sherlock-audit/2023-12-ubiquity-judging#71 as invalid.

@rndquu
Copy link
Member Author

rndquu commented Mar 4, 2024

Marking sherlock-audit/2023-12-ubiquity-judging#160 as invalid because:

  1. Yul's delegatecall() doesn't have msg.value in params (check the docs and related SO question here)
  2. I've double checked our Diamond implementation, all payable methods are working fine (i.e. accept ETH if you send it)

Copy link

ubiquibot bot commented Mar 20, 2024

! No price label has been set. Skipping permit generation.

@rndquu rndquu unpinned this issue Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants