You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-1
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,19 @@ The library lets you concatenate, slice and type cast bytes arrays both in memor
8
8
9
9
Given this library has an all-internal collection of methods it doesn't make sense having it reside in the mainnet. Instead it will only be available in EPM as an installable package.
10
10
11
-
_Version Notes_:
11
+
## Important Fixes Changelog
12
+
13
+
There was a **critical bug** in the `slice` method, reported on an audit to a DXDao codebase.
14
+
15
+
Previously, no checks were being made on overflows of the `_start` and `_length` parameters since previous reviews of the codebase deemed this overflow "unexploitable" because of an inordinate expansion of memory (i.e., reading an immensely large memory offset causing huge memory expansion) resulting in an out-of-gas exception.
16
+
17
+
However, as noted in the review mentioned above, this is not the case. The `slice` method in versions `<=0.9.0` actually allows for arbitrary _kind of_ (i.e., it allows memory writes to very specific values) arbitrary memory writes _in the specific case where these parameters are user-supplied inputs and not hardcoded values (which is uncommon).
18
+
19
+
This made me realize that in permissioned blockchains where gas is also not a limiting factor this could become problematic in other methods and so I updated all typecasting-related methods to include new bound checks as well.
20
+
21
+
**TL;DR: if you're using the `slice` method with user-supplied inputs in your codebase please update the bytes library immediately!**
22
+
23
+
## _Version Notes_:
12
24
13
25
* Version `v0.9.0` now compiles with Solidity compilers `0.5.x` and `0.6.x`.
0 commit comments