Knowledge · Bare metal

Checking Keil firmware for known vulnerabilities

Read the libraries and versions from the AXF first, then match them against vulnerability databases such as the NVD.

The best file for this is the AXF, not the BIN. The AXF is an ELF file with symbols and sections from which CMSIS packs, the RTOS and TLS libraries can be read together with their versions.

As of 23 October 2026 · 6 min read

The test subject
Project
AmbiqSuite, ble_freertos_amota, Keil MDK
Chip
Ambiq Apollo3, Cortex-M4
AXF
2,503,136 bytes
BIN
100,620 bytes
SHA-256 (AXF)
f33f7663bbd8b3fb4da733c57b008e439265ac688438b5c637da3c890e19fd13

Public on GitHub, commit e280cbd

The test subject: Public on GitHub, commit e280cbd

Why the AXF and not the BIN?

The Keil linker (armlink) writes the AXF as an ELF file. It holds the symbol table with the function names, the program sections and, depending on the project settings, debug information with source paths. A function name such as mbedtls_ssl_handshake or xTaskCreate shows that mbedTLS or FreeRTOS is linked. A source path such as third_party/FreeRTOSv10.1.1 often names the version already.

The BIN is produced from it with fromelf --bin and holds only the bytes written to flash. Symbols and paths are gone. What remains is text a library compiles in itself, such as a version string. Not every library does that.

On the test subject above: the AXF names the FreeRTOS path with its version 406 times, the BIN of the same build not once. The BIN keeps only the names of the FreeRTOS tasks, without a version.

The section table shows why. Only the FLASH section with 0x17fb8 bytes and the initial values for SRAM with 0x954 bytes go into the BIN. Together that is 100,620 bytes, exactly the size of the BIN. Debug information, symbol table and .comment, 2,402,516 bytes in total, exist only in the AXF.

Count the version in the AXF and in the BIN
strings -a ble_freertos_amota.axf | grep -c "FreeRTOSv10.1.1"strings -a ble_freertos_amota.bin | grep -c "FreeRTOSv10.1.1"

Output

406
0
What is left of FreeRTOS in the BIN
strings -a -t x ble_freertos_amota.bin | grep -E "Tmr Svc|IDLE"

Output

13108IDLE14694Tmr Svc
Which sections go into the BIN and which do not
readelf -S ble_freertos_amota.axf | grep -E " (FLASH|SRAM|\.debug_info|\.symtab|\.comment) "

Output

  [ 1] FLASH             PROGBITS        0000c000 000034 017fb8 00  AX  0   0  4
  [ 2] SRAM              PROGBITS        10000000 017fec 000954 00  WA  0   0  4
  [ 3] SRAM              NOBITS          10000d50 018940 00b9e8 00  WA  0   0  8
  [ 6] .debug_info       PROGBITS        00000000 01fe90 0e68fc 00      0   0  1
  [11] .symtab           SYMTAB          00000000 1baf64 010f40 10     12 3217  4
  [14] .comment          PROGBITS        00000000 1dbbe0 0872cc 00      0   0  1

How do I check a Keil build for CVEs by hand?

  1. 1

    Read the packs from the project

    in the project file (.uvprojx), <PackID> names the Device Family Pack with its version. <RTE> lists software components included from packs. Libraries copied into the project as source code do not appear there.

  2. 2

    Find the linked libraries

    fromelf --text -s firmware.axf (Arm) or arm-none-eabi-nm firmware.axf lists the symbols. Prefixes such as mbedtls_, lwip_, wolfSSL_ or osKernel name the library.

  3. 3

    Read compiler and toolchain

    arm-none-eabi-readelf -p .comment firmware.axf shows which compiler built it, and the command lines of compiler and linker.

  4. 4

    Add the map file

    with --map and --list=file, armlink writes the memory map with every input section to a text file. --info=sizes,totals lists code and data per object and library member, --info=unused the removed sections.

  5. 5

    Look for versions

    strings -a firmware.axf | grep -iE "version|v[0-9]+\.[0-9]+" finds version strings where a library compiles one in. Source paths in the debug information often carry the version in a folder name.

  6. 6

    Match

    look up name and version as a CPE in the NVD dictionary and check the CVEs listed for it. Add the CISA KEV catalogue and ENISA's EUVD for vulnerabilities that are actively exploited.

  7. 7

    Check with the vendor

    the pack vendor's release notes say from which version a vulnerability is fixed.

Recognise linked libraries by their functions
nm ble_freertos_amota.axf | grep -E " T (xTaskCreate|vTaskStartScheduler|uECC_make_key|WsfOsInit|am_hal_ble_initialize)$"

Output

0001180dT am_hal_ble_initialize0001e971T uECC_make_key0001f09dT vTaskStartScheduler000106e9T WsfOsInit00020311T xTaskCreate
Compiler and version
strings -a ble_freertos_amota.axf | grep -m1 "Component: ARM Compiler"

Output

Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
Version from the source path
strings -a ble_freertos_amota.axf | grep -m1 -o "third_party/FreeRTOSv[0-9.]*"
Output
third_party/FreeRTOSv10.1.1

What is in the .comment section of an AXF?

In the test subject, .comment holds the Arm Compiler 5 tools involved, with their versions and command lines. The linker call comes first. Then follow the libraries of the Arm C runtime that the linker pulled in, and for every object file the compiler call with all include paths.

From this you read three things for the SBOM: the toolchain's runtime libraries, whether a map file was written, and which pack version was really on the include path at compile time.

The Arm C libraries in the image
strings -a ble_freertos_amota.axf | grep -o 'armlib\\[a-z_]*\.l' | sort -u

Output

armlib\c_w.l
armlib\fz_wm.l
armlib\h_w.l
armlib\m_wm.l
armlib\vfpsupport.l
Did the build write a map file?
strings -a ble_freertos_amota.axf | grep -m1 -o -- "--list=[^ ]*"strings -a ble_freertos_amota.axf | grep -m1 -o -- "--info=[^ ]*"

Output

--list=.\Listings\ble_freertos_amota.map
--info=summarysizes,sizes,totals,unused,veneers
Pack version: project file against build
grep -o "<PackID>.*</PackID>" ble_freertos_amota.uvprojxstrings -a ble_freertos_amota.axf | grep -o 'Apollo_DFP\\[0-9.]*' | sort | uniq -c

Output

<PackID>AmbiqMicro.Apollo_DFP.1.1.0</PackID>
    194 Apollo_DFP\1.1.3

What are the pitfalls with Keil builds?

The last line sits at offset 0x15404a, in the .debug_macinfo section. In DWARF that is the section for the source code's macros. So the AXF carries the FreeRTOS version twice: in the source path and in the macro from task.h. The BIN of the same build has neither.

  1. 1

    Only the BIN is available

    then symbols, source paths and .comment are missing. Ask for the AXF of the same build. In the test subject both sit in the bin folder: a post-build command in the project produces the BIN from the AXF with fromelf --bin.

  2. 2

    Pack version from the project file

    in the test subject the project file names Apollo_DFP 1.1.0. It was compiled against the headers of 1.1.3, as 194 compiler calls in the AXF show. The SBOM takes the version the build used.

  3. 3

    Empty RTE

    in the test subject <RTE> is empty. FreeRTOS, the BLE stack and micro-ecc sit as copies under third_party in the project. They show only in source paths and function names.

  4. 4

    Precompiled library

    the Ambiq HAL comes as libam_hal.lib. The AXF carries its function names and the command lines Ambiq compiled it with, but no version number.

  5. 5

    Unused code

    armlink removes unused sections, the default is --remove. With --split_sections, as in the test subject, every function sits in its own section. vTaskEndScheduler is in tasks.c but not in the AXF. Whether a reported vulnerability has code in the device is answered by the symbol table.

RTE in the test subject's project file
grep -A4 "<RTE>" ble_freertos_amota.uvprojx

Output

  <RTE>
    <apis/>
    <components/>
    <files/>
  </RTE>
In the source, not in the image
grep -n "^void vTaskEndScheduler" tasks.cnm ble_freertos_amota.axf | grep -E " T vTask(Start|End)Scheduler$"

Output

2061:void vTaskEndScheduler( void )
0001f09d T vTaskStartScheduler
The FreeRTOS version a second time, as a macro
strings -a ble_freertos_amota.axf | grep -m1 'tskKERNEL_VERSION_NUMBER'

Output

.tskKERNEL_VERSION_NUMBER "V10.1.1"

Can this run automatically?

Microcontroller builds from Keil MDK, IAR or GNU Arm. It finds the libraries built in, with their versions, for example CMSIS packs, RTX5, FreeRTOS, lwIP, mbedTLS and STM32Cube. Plus hardening (stack canary, MPU, privilege separation) and embedded keys.

Every component with an evidenced version is matched against the vulnerability sources and says where in the build it sits. If the binary evidences no version, the field stays blank.

Intel HEX and Motorola S-record: Converted to bytes and analysed like the BIN of the same build. When the AXF is there, they get its components with their versions.

Check your own image

One firmware image or a supplier SBOM, one findings report, free. The reports are in German. Rather look at it together? Ben Plannet, CTO, walks through your file with you in 30 minutes.

What can be read from a Keil build?

SourceWhat it tells you
Symbol tableWhich libraries are linked (function names)
Debug informationSource paths, often with the version in a folder name, plus macros such as tskKERNEL_VERSION_NUMBER
Section .commentCompiler and version, linker command line, runtime libraries, include paths with the pack version
Version recordsVersions a library stores itself, for example RTX5
Text in the binaryVersion strings, where the library compiles one in
Map file (.map)Every input section with address and size, with --info=unused also the removed ones
Project file (.uvprojx)Device Family Pack with version, RTE components, groups and files

Questions

Is the BIN enough for a vulnerability check?

Partly. The BIN lacks symbols and paths; only text a library compiles in itself remains. In the example above the BIN loses the FreeRTOS version entirely. If you have the AXF of the same build, use the AXF.

Do I need the source code?

No. The AXF carries enough information to determine the libraries and many versions. The project file (.uvprojx) helps on top, because it names the Device Family Pack with its version.

How do I find the compiler version of a Keil build?

In the AXF's .comment section and in the debug information. In the example it reads ARM Compiler 5.06 update 6 (build 750). fromelf --text shows the same under „Built with“.

Is a function in the AXF just because it is in the source?

No. armlink removes unused sections by default. In the example vTaskEndScheduler is in tasks.c, the AXF does not contain it. For a reported vulnerability, check whether the affected function is in the symbol table.

Does this work with IAR or GCC too?

Yes. IAR Embedded Workbench writes an .out file, the GNU Arm compiler an .elf file. Both are ELF files and are read the same way.

What about an Intel HEX file?

HEX is a text encoding of the same bytes as the BIN. For the check the AXF is better, because the HEX holds no symbols.

Sources

  1. [1]Arm: fromelf, Arm Compiler for Embedded Reference Guide
  2. [2]Arm: armlink User Guide, Arm Compiler 6.6 (--remove, --map, --info)
  3. [3]Arm: fromelf User Guide, Arm Compiler 6.11 (--bin, --text)
  4. [4]GNU Binutils: readelf and nm
  5. [5]NIST NVD: CPE dictionary
  6. [6]CISA: Known Exploited Vulnerabilities Catalog
  7. [7]ENISA: European Vulnerability Database (EUVD)
  8. [8]Arm: CMSIS-Pack, pack description (PDSC)
  9. [9]Test subject: keil project folder, AmbiqSuiteSDK commit e280cbd

Check your own image

Upload one firmware image, an AXF or a supplier SBOM in your own LegacyMind account. Report and SBOM within three working days, NDA on request. The app and the reports are in German; questions in English are welcome.

One image per company is free, with a business e-mail address; the number of free checks per day is limited. Terms (German)

Rather look at it together? Ben Plannet, CTO, walks through your file with you in 30 minutes. Pick a time (calendar in German)

Free · one image

Upload firmware, read the report

We send the link to the report to your business e-mail address.

Firmware file

Choose a file or drop it here

BIN, IMG, HEX, AXF, ELF, OUT, TAR, ZIP, TRX, CHK and more, up to 2 GB. No source code.

The upload waits until the NDA is signed. We send it to you by mail.

Report and SBOM within three working days. Servers in Germany; we delete the file after the analysis and the report after 30 days. Privacy (German)

LegacyMind GmbH · Ingolstadt, Germany · HRB 12510 · What happens to your firmware