Compare commits

...

4 Commits

Author SHA1 Message Date
dependabot[bot]
7d9f07414c build(deps-dev): bump build from 1.3.0 to 1.4.0
Bumps [build](https://github.com/pypa/build) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/pypa/build/releases)
- [Changelog](https://github.com/pypa/build/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pypa/build/compare/1.3.0...1.4.0)

---
updated-dependencies:
- dependency-name: build
  dependency-version: 1.4.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-12 18:29:07 +00:00
kamran ul haq
7f3e35ee62 loader: gracefully handle ELF files with unsupported architectures (#2800)
* loader: gracefully handle ELF files with unsupported architectures

When analyzing ELF files with unsupported architectures (e.g., ARM64 variant),
vivisect raises a generic Exception with message 'Unsupported Architecture: %d'.
This was not caught by existing error handlers, causing capa to crash with an
unfriendly error message.

This change adds exception handling to detect the 'Unsupported Architecture'
error message and convert it to a user-friendly CorruptFile exception,
following the same pattern as the existing 'Couldn't convert rva' handler.

The architecture number is extracted from the exception args and included
in the error message to help users understand what went wrong.

closes #2793

* loader: address review feedback for PR #2800

- Add e.args check to prevent IndexError when accessing exception arguments
- Use error_msg variable instead of directly accessing e.args[0]
- Update CHANGELOG to reference PR #2800 instead of issue #2793

Addresses feedback from @mike-hunhoff and gemini-code-assist bot

* chore: move unsupported architecture bug fix to master (unreleased) section
2026-01-09 16:20:43 -07:00
Capa Bot
80c085b08b Sync capa rules submodule 2026-01-06 17:02:03 +00:00
Capa Bot
bfd1b09176 Sync capa-testfiles submodule 2026-01-06 16:50:00 +00:00
5 changed files with 15 additions and 6 deletions

View File

@@ -8,16 +8,18 @@
### Breaking Changes
### New Rules (4)
### New Rules (5)
- nursery/run-as-nodejs-native-module mehunhoff@google.com
- nursery/inject-shellcode-using-thread-pool-work-insertion-with-tp_io still@teamt5.org
- nursery/inject-shellcode-using-thread-pool-work-insertion-with-tp_timer still@teamt5.org
- nursery/inject-shellcode-using-thread-pool-work-insertion-with-tp_work still@teamt5.org
- data-manipulation/encryption/hc-256/encrypt-data-using-hc-256 wballenthin@hex-rays.com
-
### Bug Fixes
- Fixed insecure deserialization vulnerability in YAML loading @0x1622 (#2770)
- loader: gracefully handle ELF files with unsupported architectures kamranulhaq2002@gmail.com #2800
### capa Explorer Web

View File

@@ -179,8 +179,15 @@ def get_workspace(path: Path, input_format: str, sigpaths: list[Path]):
except Exception as e:
# vivisect raises raw Exception instances, and we don't want
# to do a subclass check via isinstance.
if type(e) is Exception and "Couldn't convert rva" in e.args[0]:
raise CorruptFile(e.args[0]) from e
if type(e) is Exception and e.args:
error_msg = str(e.args[0])
if "Couldn't convert rva" in error_msg:
raise CorruptFile(error_msg) from e
elif "Unsupported Architecture" in error_msg:
# Extract architecture number if available
arch_info = e.args[1] if len(e.args) > 1 else "unknown"
raise CorruptFile(f"Unsupported architecture: {arch_info}") from e
raise
viv_utils.flirt.register_flirt_signature_analyzers(vw, [str(s) for s in sigpaths])

View File

@@ -160,7 +160,7 @@ build = [
# and should not conflict with other libraries/tooling.
"pyinstaller==6.17.0",
"setuptools==80.9.0",
"build==1.3.0"
"build==1.4.0"
]
scripts = [
# can (optionally) be more lenient on dependencies here

2
rules

Submodule rules updated: a4411edeea...6a0d506713