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
Describe the bug
We are not handling the below error in pe_file.py, we will need to handle it or not run that extractor. I have additional information on the target file, contact me on Teams if needed.
To Reproduce
Steps to reproduce the behavior:
Use unblob for extraction
Generate config on directory
Run generate on config
See error
Traceback (most recent call last):
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/surfactant/cmd/generate.py", line 492, in sbom
sw_parent, sw_children = get_software_entry(
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/surfactant/cmd/generate.py", line 58, in get_software_entry
extracted_info_results: List[object] = pluginmanager.hook.extract_file_info(
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/pluggy/_hooks.py", line 513, in __call__
return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/pluggy/_manager.py", line 120, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/pluggy/_callers.py", line 139, in _multicall
raise exception.with_traceback(exception.__traceback__)
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/pluggy/_callers.py", line 103, in _multicall
res = hook_impl.function(*args)
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/surfactant/infoextractors/pe_file.py", line 31, in extract_file_info
return extract_pe_info(filename)
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/surfactant/infoextractors/pe_file.py", line 135, in extract_pe_info
com_desc_dir = opt_hdr_data_dir[com_desc_dir_num]
IndexError: list index out of range
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/mcutshaw/.local/bin/surfactant", line 8, in <module>
sys.exit(main())
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/mcutshaw/.local/pipx/venvs/surfactant/lib/python3.10/site-packages/surfactant/cmd/generate.py", line 506, in sbom
raise RuntimeError(f"Unable to process: {filepath}") from e
RuntimeError: Unable to process:
Expected behavior
Handle error and proceed.
System Information (please complete the following information):
Ubuntu 22.04
Installed with pipx
Python 3.10
Additional Information
The traceback is truncated intentionally.
The text was updated successfully, but these errors were encountered:
From looking at the file that caused the crash, the underlying issue seems to be that the pefile library lists optional headers as being at "fixed" offsets in the list of data directories, but then omits entries that have an address/size of 0. I think this might even make some of the indices returned be invalid for directories that do exist. Also seems to relate to the issue discussed here: erocarrera/pefile#264
Describe the bug
We are not handling the below error in pe_file.py, we will need to handle it or not run that extractor. I have additional information on the target file, contact me on Teams if needed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Handle error and proceed.
System Information (please complete the following information):
Ubuntu 22.04
Installed with pipx
Python 3.10
Additional Information
The traceback is truncated intentionally.
The text was updated successfully, but these errors were encountered: