· Ayoub Zaki · Security  · 4 min read

OP-TEE: are your trusted applications really trusted?

How keeping OP-TEE’s default signing key puts your trusted world at risk.

Animated meme showing a person labelled "Trusted App" being welcomed into the "Trusted World"

A common pitfall in OP-TEE projects is overlooking the default TA signing key. Signature verification works and applications load. But leaving that key unchanged means anyone can sign a TA your device will accept.

OP-TEE provides this key only for development and testing. It is easy to leave it in the release build when using a vendor BSP or an existing build configuration.

The security risk of keeping the default key

The private key signs Trusted Applications (TAs). Its public counterpart is embedded in OP-TEE and used to verify them when they load.

Unless configured otherwise, OP-TEE uses:

TA_SIGN_KEY ?= keys/default_ta.pem
TA_PUBLIC_KEY ?= $(TA_SIGN_KEY)

An attacker still needs control of a TA delivery path.

An attacker who replaces an external TA with a malicious version using the same UUID could access its secure storage. This could expose credentials, allow misuse of keys or bypass security checks without gaining control over the OP-TEE core.

Check how your BSP or build system configures the TA signing key. The references below include OP-TEE recipes and package information for Yocto, Buildroot, Debian, Isar and CIP as starting points for reviewing your integration.

Secure Boot and a verified root filesystem are not enough

Secure Boot authenticates the OP-TEE image and a verified root filesystem protects the files on disk. Neither prevents Linux from being compromised at runtime.

External TAs are usually delivered through tee-supplicant. An attacker who controls this path can supply a malicious TA at load time without changing the verified files on disk.

This also matters when preparing for the Cyber Resilience Act. Annex I includes requirements for secure defaults, protection against unauthorised access and software integrity. Using a publicly known private key to authorise trusted code is difficult to justify against those requirements.

Making the default harder to overlook

My contribution OP-TEE PR #8084 was merged recently. With user TAs enabled, the build rejects the bundled default signing key when CFG_INSECURE=n.

CFG_INSECURE=y is enabled by default and allows insecure development settings. Set it to n for production and fix the issues it exposes. Follow the OP-TEE porting guidelines to complete the platform security setup.

Signing with your own key

Generate a dedicated RSA key pair:

openssl genpkey -algorithm RSA \
    -pkeyopt rsa_keygen_bits:3072 \
    -out ta-signing-private.pem

For a local build, add these settings to your existing OP-TEE build command:

CFG_INSECURE=n
TA_SIGN_KEY=/path/to/ta-signing-private.pem

OP-TEE extracts the public key from this file and embeds it in the firmware. Pass the same TA_SIGN_KEY when building external TAs.

This command creates an unencrypted private key for a local test. Keep production private keys in a controlled signing environment. OP-TEE’s offline signing flow allows production builds and release signing to be separated.

OP-TEE’s TA signing tool does not currently support direct PKCS#11 signing. Offline HSM signing is supported but requires separate digest signing and signature assembly steps.

I have also submitted OP-TEE PR #8002 to add ECDSA NIST P-256 support for TA signing and verification. This contribution is still pending upstream at the time of writing.

A fixed set of TAs? Disable external loading

For products with a fixed set of trusted applications, OP-TEE supports early TAs embedded directly in its firmware image. Their authenticity is then covered by the boot chain authenticating OP-TEE. This can be simpler than managing separate TA signing key files.

Add these settings to your OP-TEE configuration file alongside the production settings above. This example embeds the in-tree PKCS#11, trusted keys and AVB TAs:

CFG_WITH_USER_TA=y
CFG_EARLY_TA=y
CFG_REE_FS_TA=n
CFG_SECSTOR_TA=n
CFG_IN_TREE_EARLY_TAS+=pkcs11/fd02c9da-306c-48c7-a49c-bbd827ae86ee
CFG_IN_TREE_EARLY_TAS+=trusted_keys/f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c
CFG_IN_TREE_EARLY_TAS+=avb/023f8f1a-292a-432b-8fc4-de8471358067

This disables the standard external TA stores while retaining embedded user-mode applications. Updating an early TA requires updating the OP-TEE image.

References

Embetrix helps customers secure embedded Linux products, from Secure Boot and OP-TEE integration to TA signing and key management. If your product needs a review of its trusted application workflow, please get in touch.

Back to Blog

Related Posts

View All Posts »