Binary
File analysis
Within the .files[].executable sections of the Syft JSON there is an analysis of what features and claims were found within a binary file.
This includes:
- Imported libraries (use of shared libraries)
- Exported symbols
- Security features (like NX, PIE, RELRO, etc)
Security features that can be detected include:
- if debugging symbols have been stripped
- presence of Stack Canaries to protect against stack smashing (which lead to buffer overflows)
- NoExecute (NX) bit support to prevent execution of code on the stack or heap
- Relocation Read-Only (RelRO) to protect the Global Offset Table (GOT) from being overwritten (can be “partial” or “full”)
- Position Independent Executable (PIE) support such that offsets are used instead of absolute addresses
- if it is a Dynamic Shared Object (DSO) (not a security feature, but important for analysis)
- LLVM SafeStack partitioning is in use, which separates unsafe stack objects from safe stack objects to mitigate stack-based memory corruption vulnerabilities
- LLVM Control Flow Integrity (CFI) is in use, which adds runtime checks to ensure that indirect function calls only target valid functions, helping to prevent control-flow hijacking attacks
- Clang Fortified Builds is enabled, which adds additional runtime checks for certain standard library functions to detect buffer overflows and other memory errors
When it comes to shared library requirement claims and exported symbol claims, these are used by Syft to:
- associate
file-to-filerelationships (in the case of executables/shared libraries being distributed without a package manager) - associate
file-to-packagerelationships (when an executable imports a shared library that is managed by a package manager)
Syft can synthesize a dependency graph from the imported libraries and exported symbols found within a set of binaries, even if all package manager information has been removed, allowing for a more complete SBOM to be generated. In a mixed case, where there are some packages managed by package managers and some binaries without package manager metadata, Syft can still use the binary analysis to fill in the gaps. Package-level relationships are preferred over file-level relationships when both are available, which simplifies the dependency graph.
Package analysis
ELF package notes
Syft is capable of looking at ELF formatted binaries, specifically the .note.package note, that are formatted using the convention established by the systemd project.
This spec requires a PE/COFF section that wraps a json payload describing the package metadata for the binary, however, syft does not require the PE/COFF wrapping and can extract the json payload directly from the ELF note.
Here’s an example of what the json payload looks like:
{
"name": "my-application",
"version": "1.2.3",
"purl": "pkg:deb/debian/my-application@1.2.3?arch=amd64&distro=debian-12",
"cpe": "cpe:2.3:a:vendor:my-application:1.2.3:*:*:*:*:*:*:*",
"license": "Apache-2.0",
"type": "deb"
}
Which, if stored in payload.json, can be injected into an existing ELF binary using the following command:
objcopy --add-section .note.package=payload.json --set-section-flags .note.package=noload,readonly
Known patterns
| Cataloger + Evidence | License | Dependencies | Package Manager Claims | ||||
|---|---|---|---|---|---|---|---|
| Depth | Edges | Kinds | Files | Digests | Integrity Hash | ||
binary-classifier-cataloger (see table below) | |||||||
elf-binary-package-cataloger application/x-executable, application/x-mach-binary, application/x-elf, application/x-sharedlib, application/vnd.microsoft.portable-executable (mimetype) | |||||||
pe-binary-package-cataloger *.dll, *.exe | |||||||
| Class | Files | PURL | CPEs |
|---|---|---|---|
| arangodb-binary | arangosh | pkg:generic/arangodb | cpe:2.3:a:arangodb:arangodb:*:*:*:*:*:*:*:* |
| bash-binary | bash | pkg:generic/bash | cpe:2.3:a:gnu:bash:*:*:*:*:*:*:*:* |
| busybox-binary | busybox | pkg:generic/busybox | cpe:2.3:a:busybox:busybox:*:*:*:*:*:*:*:* |
| chrome-binary | chrome | pkg:generic/chrome | cpe:2.3:a:google:chrome:*:*:*:*:*:*:*:* |
| consul-binary | consul | pkg:golang/github.com/hashicorp/consul | cpe:2.3:a:hashicorp:consul:*:*:*:*:*:*:*:* |
| curl-binary | curl | pkg:generic/curl | cpe:2.3:a:haxx:curl:*:*:*:*:*:*:*:* |
| dart-binary | dart | pkg:generic/dart | cpe:2.3:a:dart:dart_software_development_kit:*:*:*:*:*:*:*:* |
| elixir-binary | elixir | pkg:generic/elixir | cpe:2.3:a:elixir-lang:elixir:*:*:*:*:*:*:*:* |
| elixir-library | elixir/ebin/elixir.app | pkg:generic/elixir | cpe:2.3:a:elixir-lang:elixir:*:*:*:*:*:*:*:* |
| erlang-alpine-binary | beam.smp | pkg:generic/erlang | cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:* |
| erlang-binary | erlexec | pkg:generic/erlang | cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:* |
| erlang-library | liberts_internal.a | pkg:generic/erlang | cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:* |
| ffmpeg-binary | ffmpeg | pkg:generic/ffmpeg | cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:* |
| ffmpeg-library | libav* | pkg:generic/ffmpeg | cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:* |
| ffmpeg-library | libswresample* | pkg:generic/ffmpeg | cpe:2.3:a:ffmpeg:ffmpeg:*:*:*:*:*:*:*:* |
| fluent-bit-binary | fluent-bit | pkg:github/fluent/fluent-bit | cpe:2.3:a:treasuredata:fluent_bit:*:*:*:*:*:*:*:* |
| gcc-binary | gcc | pkg:generic/gcc | cpe:2.3:a:gnu:gcc:*:*:*:*:*:*:*:* |
| go-binary | go | pkg:generic/go | cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* |
| go-binary-hint | VERSION* | pkg:generic/go | cpe:2.3:a:golang:go:*:*:*:*:*:*:*:* |
| gzip-binary | gzip | pkg:generic/gzip | cpe:2.3:a:gnu:gzip:*:*:*:*:*:*:*:* |
| haproxy-binary | haproxy | pkg:generic/haproxy | cpe:2.3:a:haproxy:haproxy:*:*:*:*:*:*:*:* |
| hashicorp-vault-binary | vault | pkg:golang/github.com/hashicorp/vault | cpe:2.3:a:hashicorp:vault:*:*:*:*:*:*:*:* |
| haskell-cabal-binary | cabal | pkg:generic/haskell/cabal | cpe:2.3:a:haskell:cabal:*:*:*:*:*:*:*:* |
| haskell-ghc-binary | ghc* | pkg:generic/haskell/ghc | cpe:2.3:a:haskell:ghc:*:*:*:*:*:*:*:* |
| haskell-stack-binary | stack | pkg:generic/haskell/stack | cpe:2.3:a:haskell:stack:*:*:*:*:*:*:*:* |
| helm | helm | pkg:golang/helm.sh/helm | cpe:2.3:a:helm:helm:*:*:*:*:*:*:*:* |
| httpd-binary | httpd | pkg:generic/httpd | cpe:2.3:a:apache:http_server:*:*:*:*:*:*:*:* |
| java-binary | java | pkg:generic/oracle/graalvmpkg:generic/azul/zulupkg:generic/oracle/openjdkpkg:generic/oracle/openjdkpkg:generic/ibm/javapkg:generic/oracle/jrepkg:generic/oracle/jre | cpe:2.3:a:oracle:graalvm:*:*:*:*:*:*:*:*cpe:2.3:a:azul:zulu:*:*:*:*:*:*:*:*cpe:2.3:a:oracle:openjdk:{{.primary}}:update{{.update}}:*:*:*:*:*:*cpe:2.3:a:oracle:openjdk:*:*:*:*:*:*:*:*cpe:2.3:a:ibm:java:*:*:*:*:*:*:*:*cpe:2.3:a:oracle:jre:*:*:*:*:*:*:*:*cpe:2.3:a:oracle:jre:*:*:*:*:*:*:*:* |
| java-jdb-binary | jdb | pkg:generic/oracle/graalvmpkg:generic/azul/zulupkg:generic/oracle/openjdkpkg:generic/ibm/java_sdkpkg:generic/oracle/openjdkpkg:generic/oracle/jdk | cpe:2.3:a:oracle:graalvm_for_jdk:*:*:*:*:*:*:*:*cpe:2.3:a:azul:zulu:*:*:*:*:*:*:*:*cpe:2.3:a:oracle:openjdk:*:*:*:*:*:*:*:*cpe:2.3:a:ibm:java_sdk:*:*:*:*:*:*:*:*cpe:2.3:a:oracle:openjdk:*:*:*:*:*:*:*:*cpe:2.3:a:oracle:jdk:*:*:*:*:*:*:*:* |
| jq-binary | jq | pkg:generic/jq | cpe:2.3:a:jqlang:jq:*:*:*:*:*:*:*:* |
| julia-binary | libjulia-internal.so | pkg:generic/julia | cpe:2.3:a:julialang:julia:*:*:*:*:*:*:*:* |
| lighttpd-binary | lighttpd | pkg:generic/lighttpd | cpe:2.3:a:lighttpd:lighttpd:*:*:*:*:*:*:*:* |
| mariadb-binary | {mariadb,mysql} | pkg:generic/mariadb | cpe:2.3:a:mariadb:mariadb:*:*:*:*:*:*:*:* |
| memcached-binary | memcached | pkg:generic/memcached | cpe:2.3:a:memcached:memcached:*:*:*:*:*:*:*:* |
| mysql-binary | mysql | pkg:generic/mysql | cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:* |
| mysql-binary | mysql | pkg:generic/percona-server | cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*cpe:2.3:a:percona:percona_server:*:*:*:*:*:*:*:* |
| mysql-binary | mysql | pkg:generic/percona-xtradb-cluster | cpe:2.3:a:oracle:mysql:*:*:*:*:*:*:*:*cpe:2.3:a:percona:percona_server:*:*:*:*:*:*:*:*cpe:2.3:a:percona:xtradb_cluster:*:*:*:*:*:*:*:* |
| nginx-binary | nginx | pkg:generic/nginx | cpe:2.3:a:f5:nginx:*:*:*:*:*:*:*:*cpe:2.3:a:nginx:nginx:*:*:*:*:*:*:*:* |
| nodejs-binary | node | pkg:generic/node | cpe:2.3:a:nodejs:node.js:*:*:*:*:*:*:*:* |
| openssl-binary | openssl | pkg:generic/openssl | cpe:2.3:a:openssl:openssl:*:*:*:*:*:*:*:* |
| perl-binary | perl | pkg:generic/perl | cpe:2.3:a:perl:perl:*:*:*:*:*:*:*:* |
| php-composer-binary | composer* | pkg:generic/composer | cpe:2.3:a:getcomposer:composer:*:*:*:*:*:*:*:* |
| postgresql-binary | postgres | pkg:generic/postgresql | cpe:2.3:a:postgresql:postgresql:*:*:*:*:*:*:*:* |
| proftpd-binary | proftpd | pkg:generic/proftpd | cpe:2.3:a:proftpd:proftpd:*:*:*:*:*:*:*:* |
| pypy-binary-lib | libpypy*.so* | pkg:generic/pypy | - |
| python-binary | python* | pkg:generic/python | cpe:2.3:a:python_software_foundation:python:*:*:*:*:*:*:*:*cpe:2.3:a:python:python:*:*:*:*:*:*:*:* |
| python-binary-lib | libpython*.so* | pkg:generic/python | cpe:2.3:a:python_software_foundation:python:*:*:*:*:*:*:*:*cpe:2.3:a:python:python:*:*:*:*:*:*:*:* |
| redis-binary | redis-server | pkg:generic/redis | cpe:2.3:a:redislabs:redis:*:*:*:*:*:*:*:*cpe:2.3:a:redis:redis:*:*:*:*:*:*:*:* |
| ruby-binary | ruby | pkg:generic/ruby | cpe:2.3:a:ruby-lang:ruby:*:*:*:*:*:*:*:* |
| rust-standard-library-linux | libstd-*.so | pkg:generic/rust | cpe:2.3:a:rust-lang:rust:*:*:*:*:*:*:*:* |
| rust-standard-library-macos | libstd-*.dylib | pkg:generic/rust | cpe:2.3:a:rust-lang:rust:*:*:*:*:*:*:*:* |
| sqlcipher-binary | sqlcipher | pkg:generic/sqlcipher | cpe:2.3:a:zetetic:sqlcipher:*:*:*:*:*:*:*:* |
| swipl-binary | swipl | pkg:generic/swipl | cpe:2.3:a:erlang:erlang/otp:*:*:*:*:*:*:*:* |
| traefik-binary | traefik | pkg:generic/traefik | cpe:2.3:a:traefik:traefik:*:*:*:*:*:*:*:* |
| util-linux-binary | getopt | pkg:generic/util-linux | cpe:2.3:a:kernel:util-linux:*:*:*:*:*:*:*:* |
| wordpress-cli-binary | wp | pkg:generic/wp-cli | cpe:2.3:a:wp-cli:wp-cli:*:*:*:*:*:*:*:* |
| xtrabackup-binary | xtrabackup | pkg:generic/percona-xtrabackup | cpe:2.3:a:percona:xtrabackup:*:*:*:*:*:*:*:* |
| xz-binary | xz | pkg:generic/xz | cpe:2.3:a:tukaani:xz:*:*:*:*:*:*:*:* |
| zstd-binary | zstd | pkg:generic/zstd | cpe:2.3:a:facebook:zstandard:*:*:*:*:*:*:*:* |
Vulnerability scanning
| Data Source | Disclosures | Fixes | Track by Source Package | ||
|---|---|---|---|---|---|
| Affected | Date | Versions | Date | ||
| National Vulnerability Database (NVD) | |||||
| Configuration Key | Description |
|---|---|
match.stock.using-cpes | Use CPE package identifiers to find vulnerabilities |