Skip to main content

Plack::Middleware::XSendfile CVE-2026-7381

CRITICAL
Information Exposure (CWE-200)
2026-04-29 CPANSec
9.1
CVSS 3.1 · Vendor: CPANSec
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send HTTP request with malicious headers
  2. Delivery
    Inject X-Sendfile-Type: X-Accel-Redirect
  3. Exploit
    Inject X-Accel-Mapping path rewrite
  4. Execution
    Middleware processes client-controlled configuration
  5. Persist
    Nginx X-Accel serves arbitrary file
  6. Impact
    Exfiltrate sensitive data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V14 - Data Protection Data exposure prevention
MITRE ATT&CK

2 techniques across 2 tactics: Collection, Discovery

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires Plack application deployed behind nginx reverse proxy with Plack::Middleware::XSendfile middleware enabled AND the variation setting not explicitly configured in the middleware constructor or PSGI environment variables. Exploitation is limited to nginx deployments specifically because the attack relies on nginx's X-Accel-Redirect internal redirect mechanism combined with X-Accel-Mapping path rewriting. Applications using Apache mod_xsendfile or lighttpd's X-Sendfile are not affected by this specific attack vector. The vulnerability does NOT affect applications that hardcode the sendfile type in middleware initialization, as this prevents client override via headers. Default Plack installations without explicitly adding XSendfile middleware are not vulnerable. Attack succeeds against any HTTP endpoint that triggers XSendfile middleware processing, requiring no authentication, no user interaction, and low attack complexity (CVSS: AV:N/AC:L/PR:N/UI:N). Attackers must know or guess target file paths on the server to exploit effectively, as the vulnerability enables file read but not directory traversal enumeration.

Impact

CVSS 9.1 (Critical) reflects severe technical impact with network-exploitable remote code execution potential requiring no authentication (AV:N/AC:L/PR:N/UI:N), allowing high confidentiality and integrity compromise with no availability impact (C:H/I:H/A:N). However, real-world risk is significantly lower than the CVSS suggests due to multiple limiting factors. EPSS score of 0.01% (0th percentile) indicates extremely low observed exploitation probability. The vulnerability requires a specific deployment architecture: Plack applications behind nginx reverse proxies with XSendfile middleware installed AND the variation setting not explicitly configured in code. This is not a default configuration scenario. The attack achieves arbitrary file read (confidentiality breach) but requires knowledge of target file paths on the server, limiting practical exploitation. The middleware's deprecation in version 1.0053 suggests vendor recognition of the design flaw, though deprecation is not the same as a security fix. No CISA KEV listing and no public POC reduces immediate threat. The comparison to CVE-2025-61780 provides attackers a conceptual blueprint, increasing future exploitation risk. Priority should be moderate: patch or remove the middleware for nginx deployments, but this is not the widespread critical emergency the CVSS alone suggests.

Exploit ScenarioDerived

An attacker identifies a Perl web application using Plack framework behind an nginx reverse proxy. They send an HTTP request with crafted headers: X-Sendfile-Type: X-Accel-Redirect and X-Accel-Mapping: /protected=/etc to force the middleware into nginx's internal redirect mode with custom path mapping. The application processes the request, and the middleware rewrites a file path like /protected/passwd to /etc/passwd. Nginx's X-Accel-Redirect mechanism then serves /etc/passwd contents directly to the attacker, bypassing application access controls. The attacker iterates through known sensitive file paths (/etc/shadow, application config files, database credentials) to exfiltrate server secrets. Comparison to CVE-2025-61780 provides attackers a documented proof-of-concept methodology adaptable to Plack environments.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 30, 2026

Plack::Middleware::XSendfile through version 1.0053 allows remote unauthenticated attackers to read arbitrary files from nginx-proxied servers by injecting malicious X-Sendfile-Type and X-Accel-Mapping headers. When the middleware's sendfile type is not explicitly configured, clients can force nginx's X-Accel-Redirect mode and manipulate path mappings to access sensitive files outside intended directories. The middleware has been deprecated as of version 1.0053 and will be removed in future Plack releases. EPSS score of 0.01% suggests low current exploitation activity despite the high CVSS 9.1 rating. No public exploit code identified at time of analysis, though the attack technique mirrors the documented CVE-2025-61780 vulnerability in Rack::Sendfile.

RemediationAI

Remove Plack::Middleware::XSendfile from application middleware stacks entirely, as it is deprecated in version 1.0053 and scheduled for removal from future Plack releases per vendor advisory at https://metacpan.org/release/MIYAGAWA/Plack-1.0053/view/lib/Plack/Middleware/XSendfile.pm#DEPRECATION-NOTICE. If immediate removal is not feasible, implement the following compensating controls: explicitly set the variation parameter in the middleware constructor to a fixed value (e.g., 'X-Sendfile' for Apache or 'X-Lighttpd-Send-File' for lighttpd) to prevent client override via X-Sendfile-Type headers; validate and sanitize all file paths passed to XSendfile mechanisms using allowlists of permitted directories; configure nginx to reject or strip X-Sendfile-Type and X-Accel-Mapping headers from client requests at the reverse proxy layer (note this may break legitimate application functionality if these headers are expected). For nginx deployments specifically, restrict internal location blocks used with X-Accel-Redirect to only serve from explicitly defined safe directories, and audit nginx configuration for overly permissive internal directives. Migration path: replace XSendfile middleware with direct Plack::App::File or PSGI-native static file serving, accepting the performance trade-off, or implement application-level file serving with explicit path validation.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Plack::Middleware::XSendfile is a Perl middleware component that delegates static file serving to web servers (nginx, Apache, lighttpd) using X-Sendfile mechanisms for performance optimization. The vulnerability stems from CWE-200 (Exposure of Sensitive Information to an Unauthorized Actor) where the middleware accepts client-controlled X-Sendfile-Type headers to determine the file-serving mechanism. When deployed behind nginx reverse proxies, attackers can inject X-Sendfile-Type: X-Accel-Redirect combined with X-Accel-Mapping headers to rewrite file paths. Nginx's X-Accel-Redirect feature, designed for internal redirects to protected resources, becomes exploitable when path mappings are client-controlled. Unlike the related Rack::Sendfile CVE-2025-61780, Plack's implementation disallows regex patterns in mappings and restricts mapping application to X-Accel-Redirect type only, providing partial mitigation. The affected CPE (cpe:2.3:a:miyagawa:plack::middleware::xsendfile:*:*:*:*:*:*:*:*) identifies all versions through 1.0053.

Know when Plack gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (CPANSec) PRIMARY 9.1 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

Primary rating from Vendor (CPANSec) · only source for this CVE.

CVSS VectorVendor: CPANSec

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Lifecycle Timeline

2
CVSS changed
Apr 30, 2026 - 14:22 NVD
9.1 (CRITICAL)
CVE Published
Apr 29, 2026 - 22:13 nvd
CRITICAL 9.1

DescriptionCVE.org

Plack::Middleware::XSendfile versions through 1.0053 for Perl can allow client-controlled path rewriting.

Plack::Middleware::XSendfile allows the variation setting (sendfile type) to be set by the client via the X-Sendfile-Type header, if it is not considered in the middleware constructor or the Plack environment.

A malicious client can set the X-Sendfile-Type header to "X-Accel-Redirect" to services running behind nginx reverse proxies, and then set the X-Accel-Mapping to map the path to an arbitrary file on the server.

Since 1.0053, Plack::Middleware::XSendfile is deprecated and will be removed from future releases of Plack.

This is similar to CVE-2025-61780 for Rack::Sendfile, although Plack::Middleware::XSendfile has some mitigations that disallow regular expressions to be used in the mapping, and only apply the mapping for the "X-Accel-Redirect" type.

Executive ViewAI

Why It Matters

CVE-2026-7381 affects Plack::Middleware::XSendfile and allows unauthenticated remote attackers to read arbitrary files from nginx-proxied servers through header injection attacks. Organizations running Plack applications with this middleware and nginx reverse proxies face exposure of sensitive data including configuration files, credentials, and application source code. Immediate action is required to identify and remediate affected deployments, as the deprecated component will be removed from future Plack releases.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Immediately disable Plack::Middleware::XSendfile by removing it from middleware stack if not critical to operations; (2) At nginx proxy layer, explicitly configure X-Accel-Redirect path mappings and restrict file serving to specific whitelisted directories only; (3) Implement strict input validation on X-Sendfile-Type header values to reject unexpected values; (4) Monitor and log all X-Sendfile and X-Accel headers for anomalies; (5) Restrict nginx file serving permissions to minimum necessary directories; (6) Consider disabling nginx X-Accel-Redirect functionality entirely if not required for application.

Threat Intelligence Overview

EPSS Score
0.0%
Top 100% exploitable
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
None
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Affected Products (CPE)CVE.org

cpe:2.3:a:miyagawa:plack::middleware::xsendfile:*:*:*:*:*:*:*:*

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy