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
Within the FormatString.interpret() function, when simfd.read_storage is not an instance of SimPackets, the function interprets s specifiers by locating a newline in the input file. The length of the string to be read will be inaccurately calculated under the following condition:
There is no newline in the first max_str_len bytes of the input file, AND the max_str_len-th byte is symbolic.
In such case, the interpreter will only read the first max_str_len - 1 bytes, whereas it should read all max_str_len bytes.
Only 15 bytes (symbolic vars) are read into the buf.
Traceback (most recent call last):
File "POC.py", line 30, in <module>
test_interpret_fmt_str()
File "POC.py", line 26, in test_interpret_fmt_str
assert buf[-1].symbolic
AssertionError
Environment
angr environment report
Date: 2024-05-04 15:06:37.851751
Running in virtual environment at /home/alardutp/test-angr/.venv
/home/alardutp/test-angr/.venv/lib/python3.8/site-packages/angr/misc/bug_report.py:88: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources # pylint:disable=import-outside-toplevel
Platform: linux-x86_64
Python version: 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0]
######## angr #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/angr/init.py
Pip version angr 9.2.101
Couldn't find git info
######## ailment #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/ailment/init.py
Pip version ailment 9.2.101
Couldn't find git info
######## cle #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/cle/init.py
Pip version cle 9.2.101
Couldn't find git info
######## pyvex #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/pyvex/init.py
Pip version pyvex 9.2.101
Couldn't find git info
######## claripy #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/claripy/init.py
Pip version claripy 9.2.101
Couldn't find git info
######## archinfo #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/archinfo/init.py
Pip version archinfo 9.2.101
Couldn't find git info
######## z3 #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/z3/init.py
Pip version z3-solver 4.10.2.0
Couldn't find git info
######## unicorn #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/unicorn/init.py
Pip version unicorn 2.0.1.post1
Couldn't find git info
######### Native Module Info ##########
angr: <CDLL '/home/alardutp/test-angr/.venv/lib/python3.8/site-packages/angr/state_plugins/../lib/angr_native.so', handle 2e19630 at 0x7f0c53b2adf0>
unicorn: <CDLL '/home/alardutp/test-angr/.venv/lib/python3.8/site-packages/unicorn/lib/libunicorn.so.2', handle 28808b0 at 0x7f0c56dbdc10>
pyvex: <cffi.api._make_ffi_library..FFILibrary object at 0x7f0c57a749d0>
z3: <CDLL '/home/alardutp/test-angr/.venv/lib/python3.8/site-packages/z3/lib/libz3.so', handle 23e2b40 at 0x7f0c59933730>
Additional context
No response
The text was updated successfully, but these errors were encountered:
Description
Within the
FormatString.interpret()
function, whensimfd.read_storage
is not an instance ofSimPackets
, the function interpretss
specifiers by locating a newline in the input file. The length of the string to be read will be inaccurately calculated under the following condition:max_str_len
bytes of the input file,AND the
max_str_len
-th byte is symbolic.In such case, the interpreter will only read the first
max_str_len - 1
bytes, whereas it should read allmax_str_len
bytes.Steps to reproduce the bug
test.c
Memory layout of
test
:POC.py
Only 15 bytes (symbolic vars) are read into the
buf
.Environment
angr environment report
Date: 2024-05-04 15:06:37.851751
Running in virtual environment at /home/alardutp/test-angr/.venv
/home/alardutp/test-angr/.venv/lib/python3.8/site-packages/angr/misc/bug_report.py:88: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources # pylint:disable=import-outside-toplevel
Platform: linux-x86_64
Python version: 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0]
######## angr #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/angr/init.py
Pip version angr 9.2.101
Couldn't find git info
######## ailment #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/ailment/init.py
Pip version ailment 9.2.101
Couldn't find git info
######## cle #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/cle/init.py
Pip version cle 9.2.101
Couldn't find git info
######## pyvex #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/pyvex/init.py
Pip version pyvex 9.2.101
Couldn't find git info
######## claripy #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/claripy/init.py
Pip version claripy 9.2.101
Couldn't find git info
######## archinfo #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/archinfo/init.py
Pip version archinfo 9.2.101
Couldn't find git info
######## z3 #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/z3/init.py
Pip version z3-solver 4.10.2.0
Couldn't find git info
######## unicorn #########
Python found it in /home/alardutp/test-angr/.venv/lib/python3.8/site-packages/unicorn/init.py
Pip version unicorn 2.0.1.post1
Couldn't find git info
######### Native Module Info ##########
angr: <CDLL '/home/alardutp/test-angr/.venv/lib/python3.8/site-packages/angr/state_plugins/../lib/angr_native.so', handle 2e19630 at 0x7f0c53b2adf0>
unicorn: <CDLL '/home/alardutp/test-angr/.venv/lib/python3.8/site-packages/unicorn/lib/libunicorn.so.2', handle 28808b0 at 0x7f0c56dbdc10>
pyvex: <cffi.api._make_ffi_library..FFILibrary object at 0x7f0c57a749d0>
z3: <CDLL '/home/alardutp/test-angr/.venv/lib/python3.8/site-packages/z3/lib/libz3.so', handle 23e2b40 at 0x7f0c59933730>
Additional context
No response
The text was updated successfully, but these errors were encountered: