Safeguard
Application Security•

CWE-1259 Improper Restriction of Security Token Assignment

SoCs use security tokens to tell which agent did what. CWE-1259 covers tokens that untrusted components can reassign, and the review that catches it.

Safeguard Security Team
2 min read

CWE-1259 applies to a system on a chip that uses security tokens to decide which actions an agent may take, where those tokens are not properly protected. SoC architects and verification teams are the audience.

How it happens

SoCs give a token to every agent that can generate or receive an action. The actions include read, write, program, reset, fetch and compute. An agent can hold several tokens, unique to its trust level or privileges. The tokens are how the system tells which agent did what, so the security of the SoC depends on them.

MITRE names the common failure: improperly restricting the assignment of tokens to trusted components. If an untrusted component can get or change a token, it can act with someone else's rights.

The entry's example is an AES key held in four 32-bit registers, with a control register named AES_KEY_ACCESS_POLICY. Each bit of that register stands for a token, up to 32 in all. A set bit lets the agent with that token number act on the key registers. The system has two agents, a main controller with token 1 and an auxiliary controller with token 2, and the default policy admits only one of them.

What an attacker gains

The record lists confidentiality, integrity and availability with high impact: modifying files and memory, executing unauthorized code or commands, bypassing protection mechanisms, gaining privileges or assuming identity, and crashing the system.

How to find it

The record lists no detection methods. See the mitigation below for the testing MITRE suggests.

How to fix it

MITRE recommends, at design and implementation, a security token assignment review that checks for design inconsistency and common weaknesses. The token definition and programming flow should be tested in both pre-silicon and post-silicon testing.

Quick check

What is the usual flaw?

Assignment of security tokens is not restricted to trusted components, so untrusted agents can obtain or change tokens.

When should tokens be tested?

Both before and after silicon exists, per MITRE.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.