#38530 [SC-Low] Incorrectly Eliminated Code With Side Effect In Concat Args
Description
Brief/Intro
Vulnerability Details
class Concat(BuiltinFunctionT):
...
def build_IR(self, expr, context):
...
for arg in args:
dst_data = add_ofst(bytes_data_ptr(dst), ofst)
if isinstance(arg.typ, _BytestringT):
# Ignore empty strings
if arg.typ.maxlen == 0:
continue
with arg.cache_when_complex("arg") as (b1, arg):
argdata = bytes_data_ptr(arg)
with get_bytearray_length(arg).cache_when_complex("len") as (b2, arglen):
do_copy = [
"seq",
copy_bytes(dst_data, argdata, arglen, arg.typ.maxlen), #utilize copy_bytes
["set", ofst, ["add", ofst, arglen]],
]
ret.append(b1.resolve(b2.resolve(do_copy)))
...Impact Details
References
Proof of Concept
Proof of Concept
Previous#38554 [BC-Low] Incorrect Transaction Fee Check in `SendRawTransaction()`Next#38505 [SC-Low] IRNode Multi-Evaluation In For List Iter
Was this helpful?