Improper Protection for Outbound Error Messages and Alert Signals
Description
Improper Protection for Outbound Error Messages and Alert Signals occurs when untrusted agents can disable alerts about signal conditions exceeding limits or the response mechanism that handles such alerts. Hardware devices rely on sensors to detect out-of-bounds operating conditions and trigger alert signals that prompt remedial actions like shutdown or throttling. When these protective alerts lack proper security controls, malicious software can mask or disable them, particularly affecting thermal and power management systems.
Risk
Improper alert protection has severe implications. Thermal alerts disabled causing overheating. Power alerts masked allowing damage. Protective shutdowns prevented. Hardware damage possible. Denial of service through induced failures. System instability. Safety mechanisms defeated. Component lifetime reduced. Physical damage to devices. High likelihood when alert configurations are accessible to untrusted software.
Solution
Alert signals generated by critical events should be protected from access by untrusted agents during architecture and design phase. Only hardware or trusted firmware modules should be able to alter the alert configuration. Implement access control on GPIO and interrupt configuration registers. Lock alert thresholds after secure initialization. Use hardware enforcement of alert responses that cannot be overridden by software.
Common Consequences
| Impact | Details |
|---|---|
| Availability | Scope: Availability System instability, crashes, and denial-of-service through disabled protective alerts. |
| Integrity | Scope: Integrity Safety mechanisms compromised allowing operation outside safe parameters. |
Example Code
Vulnerable Code
// Vulnerable: Thermal alert controller without access protection
module vulnerable_thermal_alert (
input wire clk,
input wire rst_n,
// Temperature sensor interface
input wire [11:0] temperature, // Current temperature (ADC value)
// Alert configuration (VULNERABLE: no protection)
input wire config_write_en,
input wire [11:0] config_threshold,
input wire config_alert_enable,
input wire [1:0] config_gpio_mask,
// Alert outputs
output reg alert_out,
output reg shutdown_request,
output reg [1:0] gpio_alert
);
// Configuration registers
reg [11:0] threshold_reg;
reg alert_enabled;
reg [1:0] gpio_mask;
// VULNERABLE: Any software can modify alert configuration
always @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
threshold_reg <= 12'hFFF; // Max threshold - no alert
alert_enabled <= 1'b1;
gpio_mask <= 2'b11;
end else if (config_write_en) begin
// VULNERABLE: No access control
threshold_reg <= config_threshold;
alert_enabled <= config_alert_enable;
gpio_mask <= config_gpio_mask;
end
end
// Temperature comparison and alert generation
wire over_temp = (temperature > threshold_reg);
always @(posedge clk) begin
// VULNERABLE: Alert can be disabled by untrusted software
if (over_temp && alert_enabled) begin
alert_out <= 1'b1;
shutdown_request <= 1'b1;
gpio_alert <= gpio_mask;
end else begin
alert_out <= 1'b0;
shutdown_request <= 1'b0;
gpio_alert <= 2'b00;
end
end
// Attack scenarios:
// 1. Set threshold_reg = 0xFFF (max) - never triggers
// 2. Set alert_enabled = 0 - alerts disabled
// 3. Set gpio_mask = 0 - GPIO signals blocked
// Result: Device overheats without triggering protection
endmodule
// Vulnerable: Power management with unprotected alerts
module vulnerable_power_alert (
input wire clk,
input wire rst_n,
// Power sensor
input wire [15:0] power_reading,
// Alert configuration
input wire cfg_write,
input wire [15:0] cfg_power_limit,
input wire cfg_alert_enable,
input wire cfg_throttle_enable,
// Alert and response
output reg power_alert,
output reg throttle_request
);
reg [15:0] power_limit;
reg alert_en;
reg throttle_en;
// VULNERABLE: Configuration accessible to all software
always @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
power_limit <= 16'd1000;
alert_en <= 1'b1;
throttle_en <= 1'b1;
end else if (cfg_write) begin
// VULNERABLE: Untrusted software can disable protection
power_limit <= cfg_power_limit;
alert_en <= cfg_alert_enable;
throttle_en <= cfg_throttle_enable;
end
end
wire over_power = (power_reading > power_limit);
// VULNERABLE: Alerts and throttling can be masked
always @(posedge clk) begin
power_alert <= over_power && alert_en;
throttle_request <= over_power && throttle_en;
end
// Attack: Disable throttle_en, run at max power
// Result: Component damage, reduced lifetime
endmodule
// Vulnerable: Software thermal management without protection
#include <stdint.h>
#include <stdbool.h>
// GPIO registers for thermal alerts
#define GPIO_THERMAL_OUT (*((volatile uint32_t*)0x40000100))
#define GPIO_THERMAL_EN (*((volatile uint32_t*)0x40000104))
#define GPIO_THERMAL_CFG (*((volatile uint32_t*)0x40000108))
// VULNERABLE: Global configuration accessible to all
static struct {
uint16_t threshold;
bool alert_enabled;
bool gpio_enabled;
} thermal_config = {
.threshold = 85, // 85°C
.alert_enabled = true,
.gpio_enabled = true
};
// VULNERABLE: Any code can modify configuration
void vulnerable_set_thermal_threshold(uint16_t threshold) {
thermal_config.threshold = threshold;
}
void vulnerable_disable_thermal_alert(void) {
thermal_config.alert_enabled = false;
GPIO_THERMAL_EN = 0; // Disable GPIO output
}
void vulnerable_mask_gpio_alert(void) {
thermal_config.gpio_enabled = false;
GPIO_THERMAL_CFG = 0; // Mask GPIO signal
}
// Attack code example:
void malicious_disable_protection(void) {
// Disable all thermal protection
vulnerable_set_thermal_threshold(0xFFFF); // Never triggers
vulnerable_disable_thermal_alert();
vulnerable_mask_gpio_alert();
// Now run intensive workload without thermal protection
// Device overheats and may be damaged
}
Fixed Code
// Fixed: Thermal alert controller with access protection
module secure_thermal_alert (
input wire clk,
input wire rst_n,
// Temperature sensor interface
input wire [11:0] temperature,
// Alert configuration (protected)
input wire config_write_en,
input wire [11:0] config_threshold,
input wire config_alert_enable,
input wire [1:0] config_gpio_mask,
input wire privileged_access, // FIXED: Privilege signal
input wire boot_complete, // FIXED: Lifecycle signal
// Alert outputs
output reg alert_out,
output reg shutdown_request,
output reg [1:0] gpio_alert,
output reg config_denied,
output reg config_locked
);
// Configuration registers
reg [11:0] threshold_reg;
reg alert_enabled;
reg [1:0] gpio_mask;
// FIXED: Safe parameter ranges
localparam MIN_THRESHOLD = 12'h100; // Minimum threshold value
localparam MAX_THRESHOLD = 12'hC00; // Maximum safe threshold
// FIXED: Lock configuration after boot
always @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
config_locked <= 1'b0;
end else if (boot_complete) begin
config_locked <= 1'b1;
end
end
// FIXED: Protected configuration with access control
always @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
threshold_reg <= 12'h800; // Safe default threshold
alert_enabled <= 1'b1; // FIXED: Always enabled by default
gpio_mask <= 2'b11;
config_denied <= 1'b0;
end else if (config_write_en) begin
config_denied <= 1'b0;
// FIXED: Check privilege and lock status
if (!privileged_access || config_locked) begin
config_denied <= 1'b1;
end else begin
// FIXED: Validate threshold range
if (config_threshold >= MIN_THRESHOLD &&
config_threshold <= MAX_THRESHOLD) begin
threshold_reg <= config_threshold;
end else begin
config_denied <= 1'b1;
end
// FIXED: Alert cannot be disabled
// alert_enabled always stays true
if (!config_alert_enable) begin
config_denied <= 1'b1; // Deny disable request
end
// FIXED: GPIO mask can only enable more signals
if (config_gpio_mask != 2'b00) begin
gpio_mask <= gpio_mask | config_gpio_mask;
end
end
end
end
// Temperature comparison
wire over_temp = (temperature > threshold_reg);
// FIXED: Hardware-enforced alert that cannot be disabled
always @(posedge clk) begin
// FIXED: Alert always active when over temperature
// No software can disable this
alert_out <= over_temp;
shutdown_request <= over_temp;
gpio_alert <= over_temp ? gpio_mask : 2'b00;
end
endmodule
// Fixed: Power alert with hardware enforcement
module secure_power_alert (
input wire clk,
input wire rst_n,
// Power sensor
input wire [15:0] power_reading,
// Protected configuration
input wire cfg_write,
input wire [15:0] cfg_power_limit,
input wire cfg_alert_enable,
input wire cfg_throttle_enable,
input wire trusted_access, // FIXED: Access control
input wire config_lock, // FIXED: Lock signal
// Alert and response
output reg power_alert,
output reg throttle_request,
output reg cfg_denied
);
reg [15:0] power_limit;
reg config_locked;
// FIXED: Hardware-enforced minimum/maximum limits
localparam MIN_POWER_LIMIT = 16'd100;
localparam MAX_POWER_LIMIT = 16'd2000;
localparam ABSOLUTE_LIMIT = 16'd2500; // Hardware enforced
// FIXED: Lock after configuration
always @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
config_locked <= 1'b0;
end else if (config_lock) begin
config_locked <= 1'b1;
end
end
// FIXED: Protected configuration
always @(posedge clk or negedge rst_n) begin
if (!rst_n) begin
power_limit <= 16'd1000;
cfg_denied <= 1'b0;
end else if (cfg_write) begin
cfg_denied <= 1'b0;
if (!trusted_access || config_locked) begin
cfg_denied <= 1'b1;
end else if (cfg_power_limit < MIN_POWER_LIMIT ||
cfg_power_limit > MAX_POWER_LIMIT) begin
cfg_denied <= 1'b1;
end else begin
power_limit <= cfg_power_limit;
end
// FIXED: Cannot disable alert or throttle
if (!cfg_alert_enable || !cfg_throttle_enable) begin
cfg_denied <= 1'b1;
end
end
end
// FIXED: Hardware-enforced alerts
wire over_config_limit = (power_reading > power_limit);
wire over_absolute_limit = (power_reading > ABSOLUTE_LIMIT);
always @(posedge clk) begin
// FIXED: Alert always active - cannot be disabled
power_alert <= over_config_limit;
// FIXED: Hardware-enforced absolute limit
// Even if config limit is set high, this triggers
throttle_request <= over_config_limit || over_absolute_limit;
end
endmodule
// Fixed: Software thermal management with protection
#include <stdint.h>
#include <stdbool.h>
// GPIO registers (same addresses but protected by hardware)
#define GPIO_THERMAL_OUT (*((volatile uint32_t*)0x40000100))
#define GPIO_THERMAL_EN (*((volatile uint32_t*)0x40000104))
#define GPIO_THERMAL_CFG (*((volatile uint32_t*)0x40000108))
#define GPIO_THERMAL_LOCK (*((volatile uint32_t*)0x4000010C))
// FIXED: Configuration with access control
typedef struct {
uint16_t threshold;
bool locked;
} secure_thermal_config_t;
static secure_thermal_config_t thermal_config = {
.threshold = 85,
.locked = false
};
// FIXED: Safe threshold bounds
#define MIN_THRESHOLD 40
#define MAX_THRESHOLD 100
// FIXED: Secure configuration with privilege check
bool secure_set_thermal_threshold(uint16_t threshold, bool privileged) {
// FIXED: Check privilege
if (!privileged) {
return false;
}
// FIXED: Check lock
if (thermal_config.locked) {
return false;
}
// FIXED: Validate range
if (threshold < MIN_THRESHOLD || threshold > MAX_THRESHOLD) {
return false;
}
thermal_config.threshold = threshold;
return true;
}
// FIXED: Lock configuration - cannot be undone
void secure_lock_thermal_config(void) {
thermal_config.locked = true;
GPIO_THERMAL_LOCK = 1; // Hardware lock
}
// FIXED: Alert cannot be disabled
// No function to disable thermal alert - it's always enabled
// FIXED: Initialization function (called during secure boot)
void secure_thermal_init(void) {
// Set safe default threshold
thermal_config.threshold = 85;
// Enable all alert outputs
GPIO_THERMAL_EN = 0xFFFFFFFF;
GPIO_THERMAL_CFG = 0xFFFFFFFF;
// FIXED: Lock configuration
secure_lock_thermal_config();
// After this, no software can modify thermal alerts
}
CVE Examples
- CVE-2020-8693: Improper access control for thermal alerts in Intel processors allowed denial of service.
- CVE-2019-11137: Insufficient access control on power management interfaces.
Related CWEs
- CWE-284: Improper Access Control (parent)
- CWE-1206: Power, Clock, Thermal, and Reset Concerns (category)
- CWE-1314: Missing Write Protection for Parametric Data Values (related)
- CAPEC-1: Accessing Functionality Not Properly Constrained by ACLs
- CAPEC-180: Exploiting Incorrectly Configured Access Control Security Levels
References
- MITRE Corporation. "CWE-1320: Improper Protection for Outbound Error Messages and Alert Signals." https://cwe.mitre.org/data/definitions/1320.html
- Intel. "Thermal Management Guidelines"
- JEDEC. "Power Management Standards"