-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #157 from pessimistic-io/develop
v0.7.0
- Loading branch information
Showing
36 changed files
with
1,099 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name: Run Benchmark | ||
|
||
on: | ||
workflow_dispatch: # Ручной запуск через UI Гитхаба | ||
jobs: | ||
RunBenchmarkOld: | ||
runs-on: ubuntu-latest | ||
env: | ||
slitherin_version: 0.1.0 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.x' | ||
- name: Update pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install solc-select | ||
run: python -m pip install solc-select | ||
- name: Install Slither | ||
run: python -m pip install slither-analyzer | ||
- name: Install Setuptools | ||
run: python -m pip install setuptools | ||
- name: Install Slitherin | ||
run: python -m pip install slitherin==$slitherin_version | ||
- name: Configure | ||
run: | | ||
cd slitherin-benchmark/ | ||
mv example.config.py config.py | ||
- name: Install benchmark requirements | ||
run: | | ||
cd slitherin-benchmark/ | ||
python -m pip install -r requirements.txt | ||
- name: Run Benchmark | ||
run: | | ||
cd slitherin-benchmark/ | ||
python runner.py -i contracts/mainnet -o mainnet.csv --limit 8000 --skip-duplicates --skip-libs --use-slither | ||
- name: Upload sheet | ||
run: | | ||
cd slitherin-benchmark/ | ||
echo $GOOGLE_JWT > service_account.json | ||
python save_sheet.py -i mainnet.csv -sa service_account.json -si $GOOGLE_SHEET_ID -ln mainnet -sv "slitherin $slitherin_version" | ||
env: | ||
GOOGLE_JWT : ${{secrets.SERVICE_ACCOUNT}} | ||
GOOGLE_SHEET_ID : ${{ secrets.GOOGLE_SHEET_ID }} | ||
- name: 'Upload Artifact' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: mainnet | ||
path: slitherin-benchmark/mainnet.csv | ||
RunBenchmarkOZOld: | ||
runs-on: ubuntu-latest | ||
env: | ||
slitherin_version: 0.1.0 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Set up Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '18.x' | ||
- name: Update pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install solc-select | ||
run: python -m pip install solc-select | ||
- name: Install Slither | ||
run: python -m pip install slither-analyzer | ||
- name: Install Setuptools | ||
run: python -m pip install setuptools | ||
- name: Install Slitherin | ||
run: python -m pip install slitherin==$slitherin_version | ||
- name: Configure | ||
run: | | ||
cd slitherin-benchmark/ | ||
mv example.config.py config.py | ||
- name: Install node dependencies | ||
run: npm ci | ||
- name: Install benchmark requirements | ||
run: | | ||
cd slitherin-benchmark/ | ||
python -m pip install -r requirements.txt | ||
- name: Run Benchmark | ||
run: | | ||
cd slitherin-benchmark/ | ||
python runner.py -i contracts/openzeppelin -o oz.csv -eo oz_extra.csv --use-slither | ||
- name: Upload sheet | ||
run: | | ||
cd slitherin-benchmark/ | ||
echo $GOOGLE_JWT > service_account.json | ||
ls | ||
python save_sheet.py -i oz.csv -sa service_account.json -si $GOOGLE_SHEET_ID -ln OZ -sv "slitherin $slitherin_version" | ||
env: | ||
GOOGLE_JWT : ${{secrets.SERVICE_ACCOUNT}} | ||
GOOGLE_SHEET_ID : ${{ secrets.GOOGLE_SHEET_ID }} | ||
- name: 'Upload Artifact' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: oz | ||
path: slitherin-benchmark/oz.csv | ||
- name: 'Upload Artifact' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: oz_extra | ||
path: slitherin-benchmark/oz_extra.csv | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Arbitrum chainlink sequencer uptime | ||
## Configuration | ||
|
||
- Check: `pess-arb-chainlink-price-feed` | ||
- Severity: `Medium` | ||
- Confidence: `Medium` | ||
|
||
## Description | ||
|
||
Sequencer uptime status should be checked. For details: [chainlink docs](https://docs.chain.link/data-feeds/l2-sequencer-feeds) | ||
|
||
## Vulnerable Scenario | ||
|
||
[test scenarios](../tests/arbitrum_chainlink_pricefeed_test.sol) | ||
|
||
## Recommendation | ||
|
||
Verify, sequencer uptmie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Balancer Readonly Reentrancy | ||
|
||
## Configuration | ||
|
||
- Check: `pess-balancer-readonly-reentrancy` | ||
- Severity: `High` | ||
- Confidence: `Medium` | ||
|
||
## Description | ||
|
||
Highlights the use of Balancer getter functions `getRate` and `getPoolTokens` (which are not checked for readonly reentrancy via `VaultReentrancyLib.ensureNotInVaultContext` or `IVault.manageUserBalance`), which return values that theoretically could be manipulated during the execution. | ||
|
||
## Vulnerable Scenario | ||
|
||
[test scenarios](../../tests/balancer/readonly_reentrancy_test.sol) | ||
|
||
## Related Attacks | ||
|
||
- [Sentimentxyz Exploit](https://quillaudits.medium.com/decoding-sentiment-protocols-1-million-exploit-quillaudits-f36bee77d376) | ||
- [Sturdy Exploit](https://blog.solidityscan.com/sturdy-finance-hack-analysis-bd8605cd2956) | ||
|
||
## Recommendation | ||
|
||
- [Official Balancer recomendation](https://docs.balancer.fi/concepts/advanced/valuing-bpt/valuing-bpt.html#on-chain-price-evaluation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Curve Readonly Reentrancy | ||
|
||
## Configuration | ||
|
||
- Check: `pess-curve-readonly-reentrancy` | ||
- Severity: `High` | ||
- Confidence: `Medium` | ||
|
||
## Description | ||
|
||
Highlights the use of Curve getter functions `get_virtual_price` and `lp_price` (which are not checked for readonly reentrancy `withdraw_admin_fee`), which return values that theoretically could be manipulated during the execution. Details: [Curve LP Oracle Manipulation](https://chainsecurity.com/curve-lp-oracle-manipulation-post-mortem/) | ||
|
||
## Vulnerable Scenario | ||
|
||
[test scenarios](../../tests/curve_readonly_reentrancy_test.sol) | ||
|
||
## Related Attacks | ||
|
||
- [Jarvis Exploit](https://www.google.com/url?q=https://blog.solidityscan.com/jarvis-polygon-pool-hack-analysis-read-only-re-entrancy-af0607e4585a&sa=D&source=editors&ust=1709713964156907&usg=AOvVaw1Oess2f9Z_UCD6vLM2hN26) | ||
- [Market.xyz Exploit](https://quillaudits.medium.com/decoding-220k-read-only-reentrancy-exploit-quillaudits-30871d728ad5) | ||
|
||
## Recomendations | ||
|
||
- Verify by calling `withdraw_admin_fee` and checking for fail of call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Curve Readonly Reentrancy | ||
|
||
## Configuration | ||
|
||
- Check: `pess-curve-vyper-reentrancy` | ||
- Severity: `High` | ||
- Confidence: `High` | ||
|
||
## Description | ||
|
||
Finds if the code is compiled with vulnerable Vyper compiler version and contains non-reentrant modifiers. | ||
Details: | ||
- [Curve exploit postmortem](https://hackmd.io/@LlamaRisk/BJzSKHNjn) | ||
- [Postmortem from Vyper team](https://hackmd.io/@vyperlang/HJUgNMhs2) | ||
|
||
## Vulnerable Scenario | ||
|
||
[test scenarios](../../tests/vyper/curve_vyper_reentrancy_test.vy) | ||
|
||
## Related Attacks | ||
|
||
- [Vyper compiler exploits](https://www.halborn.com/blog/post/explained-the-vyper-bug-hack-july-2023) | ||
|
||
## Recomendations | ||
|
||
- Upgrade the version of your Vyper compiler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Price Manipulation through token transfers | ||
|
||
## Configuration | ||
* Check: `pess-price-manipulation` | ||
* Severity: `High` | ||
* Confidence: `Low` | ||
|
||
## Description | ||
The detector finds calculations that depend on the balance and supply of some token. Such calculations could be manipulated through direct transfers to the contract, increasing its balance. | ||
|
||
## Vulnerable Scenario | ||
[test scenario](../tests/price_manipulation_test.sol) | ||
|
||
## Recommendation | ||
Avoid possible manipulations of calculations because of external transfers. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"dependencies": { | ||
"@openzeppelin/contracts": "^4.9.3" | ||
"@openzeppelin/contracts": "^4.9.3", | ||
"@balancer-labs/v2-interfaces": "^0.4.0", | ||
"@balancer-labs/v2-pool-utils": "^4.0.0" | ||
|
||
} | ||
} |
Oops, something went wrong.