CVE-2025-2040 Overview
CVE-2025-2040 affects zhijiantianya ruoyi-vue-pro version 2.4.1, a Java-based enterprise application framework. The vulnerability resides in the /admin-api/bpm/model/deploy endpoint, where user-supplied input reaches a template engine without proper neutralization of special elements [CWE-791]. Attackers with low-privileged authenticated access can exploit this flaw remotely over the network. The exploit has been publicly disclosed, increasing the likelihood of opportunistic abuse against exposed instances.
Critical Impact
An authenticated remote attacker can inject template directives into the Business Process Management (BPM) model deployment endpoint, potentially leading to server-side template evaluation and unauthorized data or command execution paths.
Affected Products
- iocoder ruoyi-vue-pro 2.4.1
- Deployments exposing the /admin-api/bpm/model/deploy endpoint
- Any downstream fork of ruoyi-vue-pro 2.4.1 that retains the vulnerable BPM deployment logic
Discovery Timeline
- 2025-03-06 - CVE-2025-2040 published to the National Vulnerability Database (NVD)
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-2040
Vulnerability Analysis
The vulnerability is classified under CWE-791: Incomplete Filtering of Special Elements, specifically in the context of a template engine. The ruoyi-vue-pro BPM subsystem accepts model deployment data through the /admin-api/bpm/model/deploy route. Input flowing into this handler is passed to a template engine without sufficient sanitization of expression syntax or control characters.
Because the endpoint sits under /admin-api/, exploitation requires an authenticated session with permissions to interact with BPM model deployment. Once inside, an attacker can craft a deployment payload containing template directives that the engine subsequently evaluates. The impact scope covers confidentiality, integrity, and availability at a limited level, consistent with server-side template evaluation constrained by the runtime context.
Root Cause
The root cause is improper neutralization of template metacharacters and expression delimiters within model deployment input. The handler forwards attacker-controlled strings into template rendering logic instead of treating them as inert data. Missing escape or allow-list validation on process definition names, keys, or descriptive fields enables the injection.
Attack Vector
The attack vector is network-based and requires low privileges but no user interaction. An authenticated attacker sends a crafted HTTP request to /admin-api/bpm/model/deploy containing template expression syntax within a field that is later rendered. The remote nature of the flaw makes internet-exposed administrative interfaces the primary risk surface.
No verified proof-of-concept code is reproduced here. Technical details and a walkthrough are published in the GitHub PoC repository and cataloged in VulDB #298783.
Detection Methods for CVE-2025-2040
Indicators of Compromise
- Unexpected POST requests to /admin-api/bpm/model/deploy containing template syntax characters such as ${, #{, <%, or {{ inside form fields.
- New or modified BPM process definitions containing script-like payloads in name, key, or description fields.
- Outbound network connections initiated by the ruoyi-vue-pro Java process shortly after a model deployment request.
Detection Strategies
- Inspect application and reverse-proxy access logs for requests to the BPM deploy endpoint that contain template expression delimiters in the request body.
- Monitor Java runtime behavior for spawned child processes or reflective class loading immediately following BPM API calls.
- Correlate authentication events with BPM deployment activity to identify low-privileged accounts performing unusual administrative operations.
Monitoring Recommendations
- Enable verbose logging on the bpm/model/deploy controller and forward events to a centralized SIEM for retention and correlation.
- Alert on any BPM model deployment performed outside change-management windows or by accounts without documented workflow-authoring duties.
- Track process execution and file-write telemetry on hosts running ruoyi-vue-pro to identify post-exploitation behavior originating from the JVM.
How to Mitigate CVE-2025-2040
Immediate Actions Required
- Restrict network access to /admin-api/* endpoints so they are reachable only from trusted management networks or via VPN.
- Audit BPM-related role assignments and remove deployment privileges from accounts that do not require them.
- Review recent BPM model deployments in version 2.4.1 environments for suspicious template syntax and revert unauthorized changes.
Patch Information
At the time of publication, the NVD entry lists no vendor advisory URL. Operators should track the upstream ruoyi-vue-pro project for a fixed release beyond 2.4.1 and consult VulDB #298783 for updated remediation guidance. Apply the vendor patch as soon as it is available and validate that the BPM deployment path performs strict input validation.
Workarounds
- Place a web application firewall (WAF) rule in front of /admin-api/bpm/model/deploy that blocks requests containing template expression delimiters such as ${, #{, and <%.
- Disable the BPM module entirely in production if workflow deployment through the API is not required by the business.
- Enforce multi-factor authentication on all administrative accounts to raise the cost of the required authenticated foothold.
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

