CVE-2021-22280
Executive Summary
CVE-2021-22280 is a high-severity local privilege escalation vulnerability affecting B&R Automation Studio versions 4.0 through 4.11. The flaw resides in improper DLL loading algorithms, allowing an authenticated local attacker to execute arbitrary code in the context of the product. With a CVSS score of 7.2, this vulnerability requires local access and authentication, but no user interaction, making it a significant threat in industrial control system (ICS) environments where multiple users share workstations. The EPSS score of 0.0% indicates low exploitation likelihood in the wild, but the lack of a confirmed patch (status UNKNOWN/UNPATCHED) elevates the risk for organizations relying on this software.
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
Supply Chain & Package Security
This vulnerability is not related to NPM, PyPI, Go, or Ruby ecosystems. It is a proprietary industrial software package from B&R Automation, distributed via their official channels. The supply chain risk is limited to the integrity of the software installation media and the trustworthiness of the vendor’s update mechanism.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Base Score: 7.2 (High)
- Attack Vector: Local (AV:L) – requires physical or remote desktop access to the system.
- Attack Complexity: Low (AC:L) – no special conditions needed.
- Privileges Required: Low (PR:L) – attacker must have a valid user account on the system.
- User Interaction: None (UI:N) – no victim action required.
- Scope: Unchanged (S:U) – the vulnerable component and the impacted component are the same.
- Confidentiality Impact: High (C:H) – full data access possible.
- Integrity Impact: High (I:H) – arbitrary code execution.
- Availability Impact: High (A:H) – potential for denial of service.
Threat Level: High. While local access is required, in shared ICS environments (e.g., engineering workstations), this vulnerability can be exploited by any authenticated user to escalate privileges and compromise the entire system.
Deep Dive & Mechanics
The vulnerability stems from improper DLL loading algorithms in B&R Automation Studio. When the application loads dynamic-link libraries (DLLs), it does not securely validate the search path. An authenticated local attacker can place a malicious DLL in a directory that the application searches before the legitimate system directory (e.g., the current working directory or a user-writable path). This is a classic DLL hijacking scenario (CWE-427: Uncontrolled Search Path Element).
Attack Flow:
- Attacker gains low-privileged access to the target system (e.g., via compromised credentials or physical access).
- Attacker identifies a DLL that Automation Studio loads without a fully qualified path.
- Attacker places a malicious DLL with the same name in a directory that is searched first (e.g., the application’s working directory or a user-writable folder in the PATH).
- When Automation Studio starts or performs a specific action, it loads the attacker’s DLL instead of the legitimate one.
- The malicious DLL executes arbitrary code in the context of the Automation Studio process, which typically runs with elevated privileges.
Affected Versions: >=4.0 and <4.12. Version 4.12 is the first patched release, but the patch status is marked as UNKNOWN/UNPATCHED in the provided data, indicating that the vendor may not have released a fix or the patch is not publicly confirmed.
Vulnerable vs. Patched Code
Since no patch details are available, we can only describe the vulnerable behavior generically.
Vulnerable Code (Conceptual):
// Vulnerable: Uses relative path or unsafe search order
HMODULE hModule = LoadLibrary(L"helper.dll"); // No full path
Patched Code (Expected):
// Patched: Uses absolute path or safe DLL search mode
HMODULE hModule = LoadLibraryEx(L"C:\\Program Files\\B&R\\Automation Studio\\helper.dll", NULL, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
The patched version should either specify the full path to the DLL or use SetDllDirectory to restrict the search path to safe directories only.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Local access to a Windows system running B&R Automation Studio version 4.0 to 4.11.
- A valid user account (low-privileged).
- Knowledge of a DLL that Automation Studio loads unsafely (e.g.,
msvcp140.dll,vcruntime140.dll, or a custom B&R DLL).
Exploitation Steps:
- Identify vulnerable DLL: Use Process Monitor (Procmon) to filter for
CreateFileoperations byAutomationStudio.exeand look forNAME NOT FOUNDresults in user-writable directories. - Craft malicious DLL: Create a DLL that exports the same functions as the target DLL but includes malicious payload (e.g., reverse shell, privilege escalation).
- Place DLL: Copy the malicious DLL to a directory that is searched before the system directory (e.g.,
C:\Users\<username>\AppData\Local\Temp\or the application’s install directory if writable). - Trigger load: Restart Automation Studio or perform an action that loads the DLL.
- Execute payload: The malicious DLL runs with the privileges of Automation Studio (often high integrity).
Example Malicious DLL Code (C++):
// malicious.cpp
#include <windows.h>
#pragma comment(lib, "ws2_32.lib")
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
// Execute reverse shell or privilege escalation
system("net localgroup Administrators attacker /add");
}
return TRUE;
}
Compile: x86_64-w64-mingw32-gcc -shared -o malicious.dll malicious.cpp
Blue Team (Detection & Defense)
Detection Steps:
- Monitor DLL loads: Use Sysmon Event ID 7 (Image loaded) to detect unexpected DLLs loaded by
AutomationStudio.exefrom user-writable paths. - File integrity monitoring: Alert on new DLL files created in directories like
%TEMP%,%APPDATA%, or the application directory. - Process auditing: Enable command-line auditing to capture any suspicious commands executed by Automation Studio.
Defense Measures:
- Apply the principle of least privilege: Run Automation Studio with a dedicated service account that has minimal permissions.
- Use AppLocker or Windows Defender Application Control (WDAC) to block execution of unsigned DLLs from user-writable paths.
- Enable Safe DLL Search Mode via registry:
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\SafeDllSearchMode= 1. - Monitor for known vulnerable versions and apply vendor patches when available.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (Placeholder – actual hashes depend on the malicious DLL)
malicious.dll:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- Process Anomalies:
AutomationStudio.exeloading DLLs fromC:\Users\*\AppData\Local\Temp\*AutomationStudio.exespawningcmd.exeorpowershell.exe
- Registry Changes:
- Creation of
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Runentries pointing to user-writable paths.
- Creation of
- Network Connections:
- Outbound connections from
AutomationStudio.exeto unknown IPs (if reverse shell used).
- Outbound connections from
Detection Engineering
YARA Rule
rule CVE_2021_22280_DLL_Hijack {
meta:
description = "Detects malicious DLLs targeting B&R Automation Studio DLL hijacking vulnerability"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2021-22280"
strings:
$s1 = "AutomationStudio.exe" nocase
$s2 = "LoadLibrary" nocase
$s3 = "helper.dll" nocase // Example vulnerable DLL name
condition:
$s1 and $s2 and $s3
}
Sigma Rule
title: CVE-2021-22280 - B&R Automation Studio DLL Hijacking
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects suspicious DLL loads by AutomationStudio.exe from user-writable directories
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2021-22280
logsource:
product: windows
service: sysmon
detection:
selection:
EventID: 7
Image|endswith: '\AutomationStudio.exe'
ImageLoaded|contains:
- '\AppData\Local\Temp\'
- '\AppData\Roaming\'
- '\Users\'
condition: selection
falsepositives:
- Legitimate DLLs placed in user directories by IT administrators
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET $HTTP_PORTS (
msg:"CVE-2021-22280 - Potential B&R Automation Studio DLL Hijack Outbound";
flow:to_server,established;
content:"AutomationStudio.exe"; nocase;
content:"|2e|dll|2e|"; distance:0;
sid:1000001;
rev:1;
)
Remediation & Mitigation
Immediate Actions:
- Upgrade: Update B&R Automation Studio to version 4.12 or later if a patch is available. Check the vendor’s official site for the latest version.
- Workaround: If patching is not possible, restrict local user permissions on engineering workstations. Use Group Policy to enforce Safe DLL Search Mode.
- Monitor: Deploy the YARA and Sigma rules above to detect exploitation attempts.
Long-Term Measures:
- Implement application whitelisting (e.g., WDAC) to block unauthorized DLLs.
- Conduct regular vulnerability scans of ICS assets.
- Train users to avoid running untrusted software on engineering workstations.
Patch Status: UNKNOWN/UNPATCHED – Contact B&R support for official patch information.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.