How KubeAgent now catches runtime CVEs like PHP2Shell
KubeAgent reads the real PHP, Node.js, Python and Ruby version inside pods, polls CVE feeds every two hours, and alerts Slack or Mattermost.
On 21 October 2026 the PHP project published fixes for two remote code execution bugs, CVE-2026-109618 and CVE-2026-109619 (CVSS 9.2), nicknamed PHP2Shell. The fixed releases are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Many production pods were affected. KubeAgent’s app scan did not flag them.
This post covers why the scan missed them and what changed.
Why the old scan missed it
The scan read versions from image tags and nothing else. That fails in four ways:
- The tag does not say what runs inside. An image like
shop-api:1.2.0, built on Ubuntu with the ondrej PHP packages, runs PHP 8.4.26. The tag has no PHP version, so the scan filed it under “unknown apps”. - Some tags are not versions at all.
php:fpm-alpineshowed up as “PHPmaster”, next to old Alpine and AlmaLinux advisories that had nothing to do with it. - There was no advisory feed for the PHP core. OSV tracks distro packages, but not PHP itself, and its data refreshes about once a day.
- Alerts needed a KubeAgent account. A cluster installed without an API key never alerted on anything.
What changed
1. Real versions from inside the pod (opt-in). With KUBEAGENT_RUNTIME_PROBE=true the agent runs one fixed, read-only shell script per distinct image and reads the PHP, Node.js, Python or Ruby version plus the package behind it. Ubuntu and ondrej images are now covered.
Where the runtime comes from decides which advisories apply:
- Debian, Ubuntu and Alpine packages are checked against OSV for that distro, because distros backport fixes without changing the upstream version.
- PPA builds and official images are checked against upstream version ranges.
- A distro the agent cannot map, such as an rpm-based image, is reported as unknown, never guessed.
2. No more noise. A tag that is not a version yields no version. A tag like 3.12 has no patch level, so it is listed as “too coarse to check” instead of being matched to advisories.
3. An advisory feed polled every two hours. The agent reads NVD (version ranges and CVSS), php.net and nodejs.org security releases. A new or changed advisory triggers a scan right away. A CVE with a CVSS of 9 or higher becomes a critical issue and is announced once. A known CVE that later turns critical is announced too. If every feed is down, runtime status reads as unknown, not clear.
4. Alerts without an account. Set KUBEAGENT_ALERT_WEBHOOK_URL to a Slack or Mattermost incoming webhook and critical findings go there directly. The URL is a credential and is never logged. A private address needs an explicit opt-in.
How we checked it
We built an end-to-end test on a real cluster with live NVD data. It runs four pods: an Ubuntu and ondrej image with PHP 8.4.26, the official php:8.4.26-fpm, the patched php:8.4.27-fpm, and php:fpm-alpine.
- Both 8.4.26 pods were flagged for CVE-2026-109618. The patched pod and the alpine pod were not.
- One critical alert reached a local webhook. A repeat scan stayed silent.
- A private webhook URL was refused by default, and a dead webhook did not break the scan.
We wrote the failure modes before the code, and two separate reviews of the change found problems we fixed before merge.
The trade-off you should know about
Reading versions from inside a pod needs pods/exec, which is command execution in your pods. It is off by default, it skips kube-system, and the Helm chart can limit it to the namespaces you list (appScan.probeNamespaces). Only turn it on where tags hide versions. For official images the tag already tells the truth, and for your own images you can put the version in an app.kubernetes.io/version label, which the scan already reads, with no exec at all.
Two limits to know: Python and Ruby come from NVD only, since python.org and ruby-lang.org publish no machine-readable security flag. And the advisory cache lives in the agent pod, so a restart re-reads the last 60 days.
Try it
helm upgrade kubeagent-agent ./charts/kubeagent-agent \
--set appScan.runtimeProbe=true \
--set 'appScan.probeNamespaces={prod}' \
--set alertWebhook.existingSecret=kubeagent-alert-webhook
The secret holds the webhook URL under the key webhook-url. From a terminal, kubeagent scan-apps --probe does the same check once.