-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cwe_checker][ERROR]: Timeout or error during cwe_checker execution #3
Comments
The most common causes for these error messages in the log are corrupted ELF binaries and timeouts. Corrupted ELF binaries are quite commonly generated if the unpacking algorithm (incorrectly) unpacks parts of a normal ELF binary as a separate binary. As a consequence the partial (and corrupted) ELF file cannot be correctly parsed, which causes the cwe_checker to throw an error, which is then logged by FACT. These types of errors can be safely ignored unless it happens for a file for which you are relatively sure that the ELF file is not corrupted. Timeouts happen if the analysis of a binary with the cwe_checker runs for more than 10 minutes, in which case the analysis is aborted. The timeout can be adjusted by changing the |
For the file in your screenshot the file type is identified as |
If I might add to that: Each file is recursively unpacked and analyzed by each selected plugin individually. What your screenshot shows is the outermost container/image file of the firmware. As @Enkelmann said, the |
Thanks. The screenshot may have had a Where do I see the actual error it is complaining about? "Timeout or error" is not very helpful when troubleshooting.
|
ELF-file, ARM... This looks like an error in the cwe_checker! Could you try to run the cwe_checker directly on some of the binaries? And if the cwe_checker throws an error, open a corresponding issue in the cwe_checker repository? Preferably with an example binary that you can share with us. |
I tried $ docker run -it --rm -v $(pwd):/input --entrypoint /bin/bash fkiecad/cwe_checker
<install file>
cwe@8896d2383126:/input$ file e2fsck
e2fsck: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.16, stripped
cwe@8896d2383126:/input$ /home/cwe/cwe_checker --version
cwe_checker 0.6.0-dev
cwe@8896d2383126:/input$ /home/cwe/cwe_checker e2fsck
|
I tried the e2fsk sample with both the stable version of the cwe_checker and with the dev-version. The stable version, which is used by FACT, did run without problems for me. So I am at a loss what the cause for the error for you is there. Maybe it has to do with the dockerization of FACT itself? Although I am spitballing here... The 0.6.0-dev version however suffers from the runtime explosion we discussed in the cwe_checker issue. It needed almost 17 minutes on my system but the analysis still managed to finish successfully. |
I did some debugging and it turns out that the database paths inside the container in combination with "docker in docker" are to blame for the error: If you don't mount your database from your host inside the container, the paths are wrong when the file is mounted inside the cwe_checker container for analysis (the docker instance outside tries to mount the file but it can't find it, since it is inside the conainer). Therefore, a fix would be to put your database folders in |
I left it running overnight and the However, this is when running it manually in its own docker. Can you help me with understanding what/where the database file is exactly and how I should be mounting it to the host (example Usually these details are hidden from the user when doing a I have dozens of docker based applications in Unraid that utilize this scheme. Using Gitlab as an example again, these folders are mapped as part of UPDATE: |
So did you get it to run? I also tried it again and got it to work with an external db the following way:
|
I have had no luck.
I'll give this a try and get back to you. |
I got permission errors when creating the folders normally as my user and using chmod 755. However, when I used
|
I see many other errors in the logs. Is this normal? [2021-10-21 15:32:03][fail_safe_file_operations][ERROR]: Could not read file: FileNotFoundError [Errno 2] No such file or directory: '/tmp/fact-docker-tmp/fact_analysis_binwalk_z6fyi8gn/1828f1cdceb0576a99be4818a302bb642f213ef68325bd2b136cb5f53bffd76f_55.png' 2021-10-21 15:34:30][docker][WARNING]: [source_code_analysis]: encountered process error while processing
ERROR: Could not connect to clamd on LocalSocket /var/run/clamav/clamd.ctl: No such file or directory |
I also see these cwe_checker related errors: [2021-10-21 16:21:15][cwe_checker][ERROR]: cwe_checker execution failed: thread 'main' panicked at 'Error while generating runtime memory image: No loadable segments found', src/caller/src/main.rs:154:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[2021-10-21 16:45:43][cwe_checker][ERROR]: cwe_checker execution failed: Execution of Ghidra plugin failed: Process was terminated.
ERROR REPORT: Import failed for file: /input (HeadlessAnalyzer) |
The cwe_checker related errors are most likely Linux kernel objects ( And yes, it is normal that the cwe_checker generates a lot of CWE warnings. Improving its analysis quality and thus also reducing the number of false positives in its warnings is part of the ongoing research for the cwe_checker. |
While analyzing a firmware image, I noticed a never ending stream of these error messages regarding cwe_checker.
What is causing this and what can I do to get cwe_checker support to work?
Under the cwe_checker tab, it says blacklisted file type.
The text was updated successfully, but these errors were encountered: