A lightweight HTTP proxy that sits between the internet and PHP-FPM, structurally sanitizing every inbound request so PHP's parsers never see attacker-crafted bytes. ~160KB static binary, zero dependencies, deploys in under a minute.
On October 21 2026, two critical remote code execution vulnerabilities were disclosed in PHP core:
- CVE-2026-109618 — heap use-after-free in the
session.upload_progresshandler - CVE-2026-109619 — heap use-after-free in the multipart form-data parser
Both are rated CVSS 9.2+ and allow unauthenticated remote code execution over the network. They affect every PHP version from 5.4 onward. Only PHP 8.2+ will receive official patches; PHP 5.x, 7.x, 8.0, and 8.1 are end-of-life and will not be patched. Researchers have dubbed this pair "php2shell" because the attack path goes from a crafted HTTP request straight to a shell on the server.
These are not the first critical parser vulnerabilities in PHP — CVE-2024-2756, CVE-2024-3096 (multipart parser), CVE-2024-11236 (session upload progress), and CVE-2026-6722 (SOAP use-after-free, CVSS 9.5) follow the same pattern. The underlying issue is structural: PHP's C-level HTTP parsers handle raw attacker-controlled bytes with complex, stateful code that has repeatedly proven vulnerable.
Discussion: Hacker News thread · Sansec research writeup · Forbes coverage · Phoenix Security analysis · Chainguard PHP image tracker
For a full technical explanation of the vulnerabilities and how the proxy stops them, see php2shell.md.
On November 17 2026, a second critical pre-authentication RCE was disclosed, this time in the Java runtime itself:
- CVE-2026-114938 — heap overflow in OpenJDK's handwritten AVX-512 VBMI Base64 decoder. A malformed short Base64 string causes a 62-byte out-of-bounds write past a heap buffer. Because Base64 is decoded before authentication, the attack surface is any Java service that accepts an
Authorizationheader — Keycloak, Jira, Confluence, Artifactory, Jenkins, and any framework (Apache Struts, Spring Boot) with an auth layer. Rated CVSS 9.8, pre-auth, single HTTP request. Researchers have named this "Java4Shell" by analogy with Log4Shell.
Discussion: Research writeup · samczsun client-side exploit
For coverage of both CVEs — including the client-side attack vector where a Java program opening an outbound TLS connection can be compromised — see java4shell.md.
Traditional WAFs use signature matching — they maintain databases of known attack patterns and try to match inbound traffic against them. This approach misses novel exploits by definition, since the signatures don't exist until after the vulnerability is discovered and analyzed.
Qbix proxy takes a fundamentally different approach: structural sanitization. It fully parses every inbound HTTP request, validates it against strict structural rules, then re-serializes the request from the parsed representation and forwards only the clean, proxy-generated bytes. The backend never sees the original wire format. There are no signatures to update.
This means:
- Exploits that depend on malformed multipart boundaries are eliminated, because the multipart body is re-serialized with a new random boundary generated by Qbix proxy.
- Exploits that depend on parser differentials between a WAF and PHP are eliminated, because PHP receives bytes that Qbix proxy generated, not bytes the attacker sent.
- Request smuggling via duplicate Content-Length, mixed Content-Length + Transfer-Encoding, or other ambiguous framing is rejected before it reaches the backend.
- Future, as-yet-unknown parser vulnerabilities in PHP are mitigated by the same mechanism — the attacker cannot control the byte-level representation that PHP parses.
- Content-Type validation — reject unknown or malformed types
- Method validation — configurable allowed methods per backend
- Multipart re-serialization — the core security invariant: multipart bodies are fully parsed, validated (file count, size, extensions, MIME types), then re-serialized with a new random boundary. The backend receives a structurally identical but byte-different body.
- JSON validation — configurable depth and string size limits
- URL-encoded body validation — re-serialized from parsed key-value pairs
- Authorization header normalization — Base64 payloads in
Authorization: BasicandAuthorization: Bearer(JWT) headers are decoded with the proxy's own C decoder and re-encoded canonically. The backend's JVM decoder never sees the client's bytes. Invalid Base64 — including the malformed short strings that trigger the AVX-512 heap overflow in CVE-2026-114938 / Java4Shell — is rejected with HTTP 400. See java4shell.md. - Header sanitization — reject non-ASCII header names, NULL bytes, bare CR/LF, duplicate Content-Length, mixed Content-Length + Transfer-Encoding
- Path traversal blocking (
/../sequences) - Chunked transfer decoding and re-validation
- Configurable size limits (body, headers, URL, query params)
- Per-backend routing and constraints
- Prometheus metrics at
/Q/metrics
- Not a WAF — no signature database, no rules to update
- Not a TLS terminator — sits behind nginx/caddy
- Not a load balancer — forwards to one matched backend per request
The fastest way to get protected is the included PHP setup helper. It detects your web server and PHP-FPM configuration automatically, shows you a colored preview of every change before touching anything, then downloads the binary, patches your configs, and installs a systemd service — all with a rollback-safe backup at each step.
Before running any setup script you download from the internet, read it. This one is ~800 lines of heavily commented PHP and is designed to be auditable — but unlike the proxy binary itself (which only touches network sockets), the setup script reads your web server config files and writes to /etc. Take two minutes to look through it, or paste it into an AI assistant and ask it to explain every step (see the section below for a one-click prompt).
# Download
curl -fsSL https://raw.githubusercontent.com/Qbix/proxy/main/qbixproxy-setup.php -o qbixproxy-setup.php
# Read it first — seriously
less qbixproxy-setup.php
# Step 1: Preview — reads config files, writes nothing, no root needed.
# Shows every change that would be made, plus exact copy-paste steps if you
# prefer to apply them yourself rather than running the script as root.
php qbixproxy-setup.php
# Step 2: Apply (only after you're satisfied with the preview)
sudo php qbixproxy-setup.phpThe helper supports nginx, Apache, and Caddy, and follows the Debian sites-available / sites-enabled symlink pattern automatically. It auto-detects all virtual hosts across all three servers and generates one backend per site with the correct document_root. If the web server's own config test (nginx -t, apachectl -t, caddy validate) fails after patching, the original config is restored from the .bak backup and no reload happens.
Flags:
--dry-run Preview changes without writing anything (default when not root)
--yes Skip the "Continue?" confirmation prompt
--server=NAME Patch only one server: nginx | apache | caddy
--help Show usage
That's exactly the right question to ask. The helper is ~800 lines of heavily commented PHP — no external dependencies, no network calls beyond running standard system commands. Read it yourself, or paste it into an AI assistant and ask it to walk you through what every step does before you run it:
→ Ask Claude to review it · → Ask ChatGPT
Or copy this prompt for any AI assistant:
I want to protect my PHP server from CVE-2026-109618 (php2shell). Please fetch
and review the Qbix proxy setup script at:
https://raw.githubusercontent.com/Qbix/proxy/main/qbixproxy-setup.php
Explain what it does step by step, confirm it is safe to run, and walk me
through the process on my server.
The AI will fetch the script from GitHub, read through every function, and guide you step by step. Most people find this more useful than a static how-to guide, because the AI can answer follow-up questions specific to your server setup.
If you prefer to download the binary yourself, or want to understand what the helper installs, here are the options.
Download from the Releases page:
| Binary | Platform | Notes |
|---|---|---|
qbixproxy-linux-x86_64 |
Linux x86_64 | Static, ~160KB, zero dependencies |
qbixproxy-linux-aarch64 |
Linux ARM64 | Static, for AWS Graviton / Ampere / RPi |
Both are statically linked with musl — zero shared library dependencies, run on any Linux system.
Verify the checksum against SHA256SUMS in the release.
# Linux x86_64
curl -LO https://github.com/Qbix/proxy/releases/latest/download/qbixproxy-linux-x86_64
chmod +x qbixproxy-linux-x86_64
./qbixproxy-linux-x86_64 --help
# Linux ARM64 (AWS Graviton, Ampere, Raspberry Pi)
curl -LO https://github.com/Qbix/proxy/releases/latest/download/qbixproxy-linux-aarch64
chmod +x qbixproxy-linux-aarch64
./qbixproxy-linux-aarch64 --help# Prerequisites: gcc (any recent version)
make # Dynamic-linked binary (development)
# For a static, zero-dependency binary:
sudo apt install musl-tools
make static # build/qbixproxy-static (~160KB)
# For a cross-platform Cosmopolitan APE binary:
make cosmo # build/qbixproxy.com (requires cosmocc in PATH)
make clean # remove build artifactsThis repo is designed to also be a build target in the Qbix PHP Webserver repo, where it compiles alongside the full webserver. Qbix proxy uses stub files to exclude features not needed in proxy-only mode (TLS, HTTP/2, WebSocket, PHP embedding, static file serving).
If you prefer to configure your web server by hand, or want to understand what the automated helper does, here are the manual steps.
- Create a config file (or copy
examples/qbixproxy.json):
{
"backends": {
"php": {
"socket": "/run/php/php-fpm.sock",
"protocol": "fastcgi",
"document_root": "/var/www/html",
"routes": ["/"],
"constraints": {
"max_body_bytes": 8388608,
"allowed_methods": ["GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS"],
"upload": {
"max_files": 20,
"max_file_bytes": 10485760,
"allowed_extensions": [".jpg", ".png", ".pdf", ".zip"]
}
}
}
}
}- Start Qbix proxy:
./qbixproxy-linux-x86_64 --config=qbixproxy.json --port=8080- Point your reverse proxy (nginx, caddy) at Qbix proxy instead of PHP-FPM directly:
Internet → nginx (TLS) :443 → qbixproxy :8080 → php-fpm.sock
nginx config:
upstream qbixproxy {
server 127.0.0.1:8080;
}
server {
listen 443 ssl;
location / {
proxy_pass http://qbixproxy;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}Qbix proxy doesn't read or write any files at runtime — it receives bytes on a socket, sanitizes them in memory, and forwards them to a backend socket. It doesn't need access to your document root, your PHP files, your uploads directory, or anything else on disk. Run it as a dedicated user with no privileges:
# Create a no-login, no-home user
sudo useradd --system --no-create-home --shell /usr/sbin/nologin qbixproxy
# The binary and config are the only files it needs to read
sudo chown root:root /usr/local/bin/qbixproxy
sudo chown root:root /etc/qbixproxy/qbixproxy.json
# Run it
sudo -u qbixproxy /usr/local/bin/qbixproxy --config=/etc/qbixproxy/qbixproxy.json --port=8080If you're using systemd (the deployment guides include ready-made service files), the service runs as this user automatically. You can go further with ProtectSystem=strict, ProtectHome=yes, NoNewPrivileges=yes, and CapabilityBoundingSet= to drop all capabilities — Qbix proxy doesn't need any. If the proxy is ever compromised, the attacker has a process that can open network sockets and nothing else.
Detailed deployment guides with before-and-after configs, systemd service files, and static file bypass — each with an automated setup section at the top:
- nginx — replace
fastcgi_passwithproxy_passthrough Qbix proxy, with a comparison table of what nginx can and can't do on its own - Apache — replace
mod_proxy_fcgiwithmod_proxy_httpthrough Qbix proxy, including mod_php → PHP-FPM migration - Caddy — replace
php_fastcgiwithreverse_proxythrough Qbix proxy
With any of these setups, your web server still handles TLS, static files, and routing as before. The only change is where PHP requests go: through Qbix proxy first, then to PHP-FPM.
The Qbix PHP Webserver is not vulnerable to php2shell out of the box. It has Qbix proxy's sanitization pipeline compiled directly into its request-handling path — every request is structurally sanitized before PHP-FPM receives it, with zero configuration and no extra process. If you're already running the Qbix webserver, you're already protected.
nginx, Apache, and Caddy don't parse multipart request bodies — they have no reason to look inside the body, so they pass the raw bytes straight through to PHP. That's exactly what php2shell exploits. The Qbix webserver parses and re-serializes those bytes before PHP ever sees them, the same way Qbix proxy does.
The Qbix webserver also handles TLS (with automatic certificate management), virtual hosting, static file serving, and HTTP/2 — so there's no reverse proxy to configure and fewer moving parts overall. If you're currently running nginx or Apache just to sit in front of PHP-FPM, it's worth a look: github.com/Qbix/webserver.
A single Qbix proxy instance can protect multiple PHP sites, each with its own document root and PHP-FPM socket. This is the typical multi-tenant or virtual-hosting setup.
Each backend can have an optional hosts array. When present, the backend only handles requests whose Host header matches one of the listed values (port suffix stripped, case-insensitive). A backend with no hosts array is a catch-all and handles any host.
{
"backends": {
"groups": {
"socket": "/run/php-fpm/groups.sock",
"protocol": "fastcgi",
"document_root": "/var/www/groups.do",
"hosts": ["groups.do", "www.groups.do"],
"routes": ["/"]
},
"qbix": {
"socket": "/run/php-fpm/qbix.sock",
"protocol": "fastcgi",
"document_root": "/var/www/qbix.com",
"hosts": ["qbix.com", "www.qbix.com"],
"routes": ["/"]
},
"default": {
"socket": "/run/php-fpm/default.sock",
"protocol": "fastcgi",
"document_root": "/var/www/html",
"routes": ["/"]
}
}
}Matching rules:
- Host-specific backends (those with
hosts) are tried first, in declaration order. - The request's
Hostheader is compared against each entry (port and case ignored). - If the host matches and the route prefix also matches, that backend handles the request.
- If no host-specific backend matches, catch-all backends (no
hostskey) are tried by route prefix.
nginx — single upstream, all sites:
With virtual hosting, you use one nginx upstream block pointing at Qbix proxy's single port, then use proxy_pass in each server {} block. Qbix proxy reads the Host header and routes to the correct backend automatically — nginx just needs to forward Host $host.
upstream qbixproxy {
server 127.0.0.1:8080;
keepalive 32;
}
server {
listen 443 ssl;
server_name groups.do www.groups.do;
# ... ssl_certificate, etc.
location ~* \.(css|js|jpg|jpeg|png|gif|ico|svg|woff2?)$ {
root /var/www/groups.do;
expires 30d;
}
location / {
proxy_pass http://qbixproxy;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection "";
}
}
server {
listen 443 ssl;
server_name qbix.com www.qbix.com;
# ... ssl_certificate, etc.
location ~* \.(css|js|jpg|jpeg|png|gif|ico|svg|woff2?)$ {
root /var/www/qbix.com;
expires 30d;
}
location / {
proxy_pass http://qbixproxy;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Connection "";
}
}The upstream block appears once; both server {} blocks share it. Qbix proxy routes by Host to the right PHP-FPM pool with the right DOCUMENT_ROOT for each site.
Backend fields:
| Field | Description |
|---|---|
socket |
Unix socket path to the backend |
protocol |
fastcgi (default) or http |
document_root |
Passed as DOCUMENT_ROOT to FastCGI |
hosts |
Optional. Host header values this backend handles. No entry = catch-all for any host. |
routes |
URL prefixes this backend handles |
constraints |
Validation limits (see examples/qbixproxy.json for all options) |
CLI flags:
--config=FILE JSON config file (required)
--port=N Listen port (default: 8080)
--host=ADDR Bind address (default: 0.0.0.0)
--root=DIR Document root
--threads=N Event loop threads (default: one per CPU core)
--access-log=F Combined-format access log
--max-post=N Max POST body in bytes
-t Test config and exit
/Q/health— JSON health check (uptime, request counts, error rates)/Q/metrics— Prometheus text format, including per-backend metrics:qbixproxy_requests_forwarded_total{backend="php"}qbixproxy_requests_rejected_total{backend="php"}qbixproxy_errors_total{backend="php"}qbixproxy_request_seconds_total{backend="php"}
┌─────────────────────────────────────┐
Client request → │ HTTP Parser (http.c) │
│ • smuggling detection │
│ • header injection prevention │
├─────────────────────────────────────┤
│ Sanitizer (sanitize.c) │
│ 1. Content-Type check │
│ 2. Method check │
│ 3. Multipart re-serialize │
│ 4. JSON depth/size check │
│ 5. URL-encoded re-serialize │
│ 6. Authorization normalize (Base64) │
│ 7. Header sanitize │
├─────────────────────────────────────┤
│ Proxy (proxy.c) │
│ • backend matching │
│ • FastCGI or HTTP forwarding │
│ • response sanitization │
└─────────────────────────────────────┘
↓
Backend (PHP-FPM / HTTP)
The entire Qbix proxy is ~3,500 lines of C across 20 source files. There are no external dependencies beyond libc and pthreads.
Open source. The complete source is in src/. Read it — that's the point. The code uses snprintf and growable buffers (ubuf) throughout; there are no calls to sprintf, strcpy, strcat, or gets. All memory allocations are bounded by configurable limits.
Reproducible builds. Release binaries are built by GitHub Actions from the source in this repo — not on anyone's laptop. The CI workflow builds on every push, and the release workflow builds, verifies, and publishes binaries when a version tag is pushed. You can inspect the build logs for any release.
Build it yourself. If you don't trust the pre-built binaries, building from source takes one command:
sudo apt install musl-tools # one-time setup
make static # produces build/qbixproxy-static (~160KB)The static binary has zero shared library dependencies and runs on any Linux system.
MIT — see LICENSE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This software is a security tool. Its effectiveness depends on correct deployment, configuration, and the threat model of your specific environment. It does not guarantee protection against all current or future vulnerabilities, exploits, or attack techniques. You are responsible for evaluating whether it is appropriate for your use case.