Preparing an embedded Linux product for the Cyber Resilience Act: threat model, secure boot, SBOM, CVE triage and OTA updates

Preparing an Embedded Linux Product for the CRA with Yocto

Share this post on:

Since 11 September 2026, a manufacturer that sells a connected product in the European Union must report the vulnerabilities attackers actively exploit in it. From 11 December 2027, every unit it places on the market must meet the whole Cyber Resilience Act (CRA). The product has to be designed for security, sold without known exploitable flaws and kept patched for years. For an embedded Linux product, most of that work lands on the build system, and a Yocto build already does a large part of it.

This article goes through what the CRA asks, then shows what a real Yocto 6.0 (Wrynose) build produces for each requirement, with the commands to read it. The examples come from the image of an Arm64 industrial product, anonymized. The boot side is covered in the chain of trust of our ARM64 series and in our x86 secure boot and RAUC article.

Contents
  1. What the CRA Asks of a Manufacturer
  2. The SBOM Comes From the Build
  3. The Vulnerability Status Is Already in the SBOM
  4. Triage in Practice: One CVE From Start to Finish
  5. Finding the New CVEs
  6. Secure by Default, in the Distro Configuration
  7. Updates for the Whole Support Period
  8. Reporting Within 24 Hours
  9. Where to Start Before December 2027

What the CRA Asks of a Manufacturer

The CRA, Regulation (EU) 2024/2847, covers hardware and software with a data connection; medical devices, vehicles and other products with their own sector rules are excluded. An industrial gateway, a controller, a camera or an HMI running Linux is in scope. The manufacturer is the company whose name is on the product, and it answers for every component of its image, open source included.

Cyber Resilience Act dates: published 20 November 2024, in force 10 December 2024, notified bodies 11 June 2026, reporting of exploited vulnerabilities 11 September 2026, all obligations 11 December 2027
Figure 1. The dates of the Cyber Resilience Act. Reporting already applies; the essential requirements apply from December 2027.

Annex I lists the essential requirements. For the product when it is sold:

  • no known exploitable vulnerability;
  • a secure configuration by default, with a way to reset to it;
  • vulnerabilities fixable by security updates;
  • protection against unauthorized access, and of the integrity and confidentiality of programs and data;
  • a limited attack surface.

For the whole support period, at least five years: an SBOM, vulnerabilities handled without delay, free security updates, a published policy for vulnerability reports. The CRA sets the results and leaves the techniques to the manufacturer, who picks the mechanisms, justifies them in a risk assessment and keeps the evidence in a technical file for ten years.

CRA Annex I requirements mapped to embedded Linux mechanisms: SBOM and CVE triage, secure defaults, secure boot and dm-verity, dm-crypt, reduced attack surface, A/B updates, vulnerability reporting
Figure 2. The essential requirements of Annex I and the embedded Linux mechanisms that usually answer them.

The SBOM Comes From the Build

BitBake knows every input of every task, from the source URL and revision to the patches, the packages and the files they contain. The create-spdx class, inherited by default, writes it down as an SPDX 3.0.1 document next to the image:

tmp/deploy/images/<machine>/<image>-<machine>.rootfs.spdx.json

In our example it weighs 90 MB, with the 1,033 packages of the image, their 43,000 files and the build tools. Each package carries its version, a package URL and a CPE, the identifiers vulnerability databases use:

{
  "type": "software_Package",
  "name": "openssl",
  "software_packageVersion": "3.5.7",
  "software_packageUrl": "pkg:yocto/core/openssl@3.5.7",
  "software_primaryPurpose": "install",
  "externalIdentifier": [
    { "externalIdentifierType": "cpe23",
      "identifier": "cpe:2.3:*:openssl:openssl:3.5.7:*:*:*:*:*:*:*" }
  ]
}

The file is not meant to be read by hand. A jq filter gives the list of what the product actually ships:

$ jq -r '."@graph"[]
    | select(.type == "software_Package" and .software_primaryPurpose == "install")
    | "\(.name) \(.software_packageVersion)"' image.rootfs.spdx.json | sort -u
busybox 1.37.0
curl 8.19.0
openssl 3.5.7
rauc 1.15.2
systemd 259.5
...

The SBOM is of the build type, so it also lists the native and cross tools that built the image, from the compiler to flex. They matter for a supply chain audit, but a CVE in flex-native does not ship. Filtering on software_primaryPurpose as above, or on the recipe name, keeps the two apart.

For the kernel, add which sources were compiled and with which configuration, so that a CVE in a driver the product does not build can be set aside:

SPDX_INCLUDE_COMPILED_SOURCES:pn-linux-yocto = "1"
SPDX_INCLUDE_KERNEL_CONFIG = "1"
SPDX_INCLUDE_PACKAGECONFIG = "1"
SPDX_INCLUDE_VEX = "all"

Prebuilt firmware and binary libraries stay opaque whatever the tool. The SBOM of every release in the field is also archived with the release, because a question asked three years later must still have an answer.

The Vulnerability Status Is Already in the SBOM

The same document holds VEX statements (Vulnerability Exploitability eXchange). For each known CVE of a recipe, they say whether the product is affected, not affected and why, or fixed. Yocto derives them from its metadata. By default, SPDX_INCLUDE_VEX = "current" keeps only the CVEs not already fixed upstream; our example sets it to all, as the sbom-cve-check fragment does, to keep the full history. Counting them on our image:

$ jq -r '."@graph"[].type | select(startswith("security_Vex"))' image.rootfs.spdx.json \
    | sort | uniq -c
      2 security_VexAffectedVulnAssessmentRelationship
  12607 security_VexFixedVulnAssessmentRelationship
     81 security_VexNotAffectedVulnAssessmentRelationship

12,368 of the fixed entries are kernel CVEs, set aside by version from the data of the kernel CNA. The 81 not-affected ones carry a reason and a justification, which is what goes into the technical file:

$ jq -r '."@graph"[]
    | select(.type == "security_VexNotAffectedVulnAssessmentRelationship")
    | [(.from | split("/")[-1]), (.to[0] | split("/")[-1]),
       .security_statusNotes, .security_impactStatement] | @tsv' image.rootfs.spdx.json
CVE-2018-6557   base-files  not-applicable-platform  Ubuntu specific motd update code
CVE-2026-12064  curl        not-applicable-config    SCP/SFTP support is not enabled in PACKAGECONFIG
CVE-2026-9547   curl        not-applicable-config    vulnerable libssh backend is not enabled by the recipe
...

Each of these lines comes from the recipes. A backported fix carries a CVE: tag in its patch header and becomes fixed; a CVE that does not apply gets a CVE_STATUS, written in a .bbappend of the product layer when the decision is yours:

CVE_STATUS[CVE-2026-12064] = "not-applicable-config: SCP/SFTP support is not enabled in PACKAGECONFIG"

Once the build tools are filtered out, 52 not-affected entries concern the image itself. Their reasons tell how much review each one deserves:

ReasonEntriesWhat it means
not-applicable-platform18the flaw is specific to another platform or distribution
not-applicable-config16the vulnerable code is not built with this configuration
disputed7upstream does not accept the report as a vulnerability
cpe-incorrect5the CVE names another product with the same name
upstream-wontfix4upstream will not fix it, by design or by choice
ignored2judged irrelevant, with a free-text justification

Most of these decisions were made by the OE-Core maintainers for a generic distribution, without knowing your product. A not-applicable-config entry holds only as long as nobody changes the PACKAGECONFIG it relies on, and an upstream-wontfix entry still needs an answer. The NTP flaw inherent to RFC 5905 is harmless on a product that syncs from a trusted server on a closed network, and a real exposure on one that listens on the Internet. The manufacturer owns these statements once they ship in its SBOM, and reviews them like its own.

Triage in Practice: One CVE From Start to Finish

The two affected entries form the triage queue, with CVEs known to apply and waiting for a fix or a decision. One of them shows the whole loop:

$ jq -r '."@graph"[]
    | select(.type == "security_VexAffectedVulnAssessmentRelationship")
    | [(.from | split("/")[-1]), (.to[0] | split("/")[-1]), .security_statusNotes] | @tsv'     image.rootfs.spdx.json
CVE-2026-10536  curl    unpatched
CVE-2016-2568   polkit  unpatched: the fix is a kernel compiled without CONFIG_LEGACY_TIOCSTI

CVE-2016-2568 is a terminal injection. A program running with less privilege uses the TIOCSTI ioctl to push characters into the input of the terminal it shares with a privileged one, which then executes them. Polkit cannot fix it on its side; since Linux 6.2, the kernel can drop TIOCSTI altogether. Whether the product is exposed is a question about its kernel configuration, and the SBOM holds the answer when the build sets SPDX_INCLUDE_KERNEL_CONFIG:

$ jq -r '."@graph"[]
    | select(.build_buildType == "https://openembedded.org/kernel-configuration")
    | .build_parameter[] | select(.key == "CONFIG_LEGACY_TIOCSTI")
    | "\(.key)=\(.value)"' image.rootfs.spdx.json
CONFIG_LEGACY_TIOCSTI=y

The option is enabled, so the CVE stands. Very few embedded products use TIOCSTI on purpose, so the fix is a configuration fragment and needs no patch. With a kernel recipe that inherits kernel-yocto, the fragment goes into the product layer, and the decision is recorded next to it:

# meta-product/recipes-kernel/linux/files/no-tiocsti.cfg
# CONFIG_LEGACY_TIOCSTI is not set

# meta-product/recipes-kernel/linux/linux-yocto_%.bbappend
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += "file://no-tiocsti.cfg"

# meta-product/recipes-extended/polkit/polkit_%.bbappend
CVE_STATUS[CVE-2016-2568] = "not-applicable-config: kernel built without CONFIG_LEGACY_TIOCSTI"

The next build carries the new kernel configuration and a not-affected statement with its justification, both traceable to one commit in the product layer. This is the evidence the CRA asks for, from the known flaw to the fix that shipped. The same kernel configuration in the SBOM also lets a release check verify the hardening options, such as CONFIG_STACKPROTECTOR_STRONG or CONFIG_STRICT_DEVMEM, instead of trusting a defconfig nobody rereads.

Finding the New CVEs

The SBOM only knows the CVEs the metadata mentions. Finding the ones published since needs a scan against the databases. Since Yocto 6.0 the cve-check class is gone, replaced by sbom-cve-check, which scans the SPDX document after the build:

$ bitbake-config-build enable-fragment core/yocto/sbom-cve-check

It writes <image>-<machine>.rootfs.sbom-cve-check.yocto.json and an annotated SPDX copy next to the image, with each CVE Patched, Unpatched or Ignored. On Scarthgap (5.0), INHERIT += "cve-check" does the same job. Names make the matching hard. The recipe tiff ships libtiff, the recipe flex has nothing to do with Apache Flex, and recent NVD records often lack product data. CVE_PRODUCT fixes the names; triage handles the rest.

Secure by Default, in the Distro Configuration

Integrity starts with secure boot, from the ROM code to the kernel, then dm-verity on a read-only root filesystem and dm-crypt on the data partition, with keys sealed in a TPM or a secure element. In the build, the rest goes into the distro configuration of the product, so that every release build applies it, whatever a developer has in local.conf.

The compiler hardening comes from meta/conf/distro/include/security_flags.inc, a file of OE-Core. It adds to every target recipe:

  • -fstack-protector-strong, a canary that detects stack buffer overflows;
  • -D_FORTIFY_SOURCE=2, bounds checks on the string and memory functions, whenever the build optimizes;
  • position-independent executables, so that address space randomization also applies to the program itself;
  • -Wformat -Wformat-security -Werror=format-security, which turns a printf with a non-literal format into a build error;
  • -Wl,-z,relro,-z,now, which resolves all symbols at startup and makes the relocation tables read-only.

Since Yocto 6.0, every distribution gets it, because defaultsetup.conf requires it. OE-Core made that change in February 2026, after years of testing it in Poky. On Scarthgap, only Poky enabled it, and a custom distribution had to require it itself. The file also lists about twenty recipes that need an exception, glibc and the GCC runtime among them. To see the flags a given recipe really gets, ask BitBake:

$ bitbake-getvar --value -r curl SECURITY_CFLAGS
-fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security

No -fPIE appears, because the Yocto GCC is configured with --enable-default-pie, so every executable is position-independent without asking, and the linker flags travel separately in SECURITY_LDFLAGS.

The rest of the distro configuration is the product’s own:

# meta-product/conf/distro/product.conf

# Scarthgap only: Yocto 6.0 already includes it
require conf/distro/include/security_flags.inc

# never in a production image: allow-root-login,
# empty-root-password, allow-empty-password
IMAGE_FEATURES += "read-only-rootfs"

Accounts and password hashes come from the extrausers class instead of patched files. The meta-security layer adds integrity measurement and access control. The usual rules still hold, with no shared password, no open console and no service the product does not need.

Updates for the Whole Support Period

Five years of patches need an update system that never bricks the product: A/B slots, boot counting with fallback, signed RAUC bundles, anti-rollback, and a bootloader that can be updated too. They also need a maintainable base. A Yocto LTS release comes out every two years and is maintained for four. Scarthgap is supported until April 2028 and Wrynose until April 2030, so the move to the next LTS is planned from the start. Builds are reproducible by default, so with the layer revisions of each release archived, a fix years later rebuilds the same image with only that fix. A BSP close to mainline follows the stable kernel branches without being rewritten, which is also why we upstream our drivers.

The archived SBOMs also write the security notice of each update. The package list of two releases, compared, gives the components that changed:

pkgs() { jq -r '."@graph"[]
    | select(.type == "software_Package" and .software_primaryPurpose == "install")
    | "\(.name) \(.software_packageVersion)"' "$1" | sort -u; }
diff <(pkgs release-1.4.spdx.json) <(pkgs release-1.5.spdx.json)

Combined with the VEX entries that moved from affected to fixed, that is the list of vulnerabilities an update corrects, which the CRA asks the manufacturer to tell its users.

Reporting Within 24 Hours

An actively exploited vulnerability goes to the ENISA single reporting platform: early warning within 24 hours, notification within 72 hours, final report within 14 days of a fix. That takes a security contact, a disclosure policy and someone in charge, and the SBOM and VEX archive of every supported release to say within hours which products are exposed.

Where to Start Before December 2027

  • a threat model of the product, in its technical file;
  • the SPDX SBOM of every release archived, with the layer revisions;
  • sbom-cve-check on every release build, and CVE_STATUS decisions kept in the product layer, including the review of those inherited from OE-Core;
  • a product distro configuration: hardening flags checked, no development image features, read-only root filesystem;
  • a secure boot chain from the ROM code to the root filesystem;
  • a fail-safe update system that covers the bootloader, and a declared support period;
  • a security contact, a disclosure policy and a 24-hour reporting process.

We put these in place on our customers’ products through our engineering services, and teach them in our secure boot and embedded Linux hardening training and a one-day Cyber Resilience Act course for product teams.

Share this post on:

Leave a Reply

Your email address will not be published. Required fields are marked *