Like a VIP badge printer that accepts handwritten names without checking the guest list
CVE-2026-18248 affects @fastify/aws-lambda (the npm package aws-lambda-fastify prior to v3, now @fastify/aws-lambda), fixed in v6.4.1. The library bridges AWS Lambda events into Fastify's HTTP processing pipeline using inject(). When processing an incoming request, the library serializes the Lambda event object into an x-apigateway-event HTTP header. The flaw: it did not strip or overwrite a client-supplied x-apigateway-event header before populating request.awsLambda.event. An unauthenticated attacker can send a crafted header containing a forged Lambda event — including spoofed requestContext.authorizer claims, source IPs, API keys, and identity context — and the application will trust it. All versions before 6.4.1 with decorateRequest enabled (the default) are affected.
The vendor's CRITICAL 9.1 rating is technically accurate for the attack mechanics: unauthenticated, network-reachable, low complexity, high confidentiality and integrity impact. However, it overstates real-world risk for most enterprises. The package has ~10,000 weekly npm downloads — a popular serverless adapter, but a tiny fraction of the Node.js ecosystem. Exploitation requires the target application to *actually read* request.awsLambda.event (or the raw header) for authorization decisions, which further narrows the vulnerable population. The blast radius is per-application, not fleet-wide. A HIGH rating better reflects the operational reality: trivially exploitable where it applies, but the 'where it applies' is narrow.
4 steps from start to impact.
Identify a Lambda API using @fastify/aws-lambda
@fastify/aws-lambda is inferred from behavior or disclosed in package-lock.json leaks.- Target API is publicly accessible via API Gateway or ALB
- Target uses @fastify/aws-lambda < 6.4.1
- Only ~10K weekly npm downloads; most Lambda APIs use other adapters (serverless-http, AWS SAM native, etc.)
- Identifying the specific adapter from outside is non-trivial
Craft a spoofed x-apigateway-event header
requestContext.authorizer.claims (e.g., elevated sub, cognito:groups, custom scopes), spoofed requestContext.identity.sourceIp, or fabricated requestContext.authorizer.principalId. The payload is sent as the x-apigateway-event HTTP header value.- No prerequisite — any HTTP client (curl, Burp Suite, custom script) suffices
- The attacker must know or guess the event structure the application expects
- API Gateway and ALB do not strip arbitrary headers by default, but WAF rules *can* block custom headers
x-apigateway-event in client requests would flag this. No standard scanner checks for this pattern today.Application trusts the spoofed event data
@fastify/aws-lambda populates request.awsLambda.event from the client-supplied header without overwriting it with the real Lambda event. Application code that checks request.awsLambda.event.requestContext.authorizer for role claims, tenant isolation, or identity context now operates on attacker-controlled data.- Application reads request.awsLambda.event or the raw header for authorization decisions
- decorateRequest option is enabled (it is by default)
- Applications using Cognito User Pools or Lambda authorizers *and* trusting the event decorator are the specific target; apps using JWT validation libraries independently are unaffected
- Applications that only use the event for logging or non-security purposes are not meaningfully impacted
Authorization bypass and data exfiltration
- Application uses event data as a trust boundary for authorization
- Blast radius is limited to the single application; no lateral movement to other Lambda functions or AWS infrastructure
The supporting signals.
| In-the-wild exploitation | No known active exploitation. Not listed on CISA KEV. No reports from threat intelligence feeds as of 2026-08-03. |
|---|---|
| Proof-of-concept | Trivial to construct. No named public PoC repo, but exploitation requires only curl -H 'x-apigateway-event: <encoded-json>' https://target/endpoint. The technique is well-documented from the analogous Hono CVE-2026-27700 Lambda adapter vulnerability. |
| EPSS | Not yet scored — FIRST EPSS API returns no data for this CVE as of 2026-08-03. Likely too new for model ingestion. |
| KEV status | Not listed. No CISA KEV entry. |
| CVSS vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N — Network-reachable, no auth required, no user interaction, high C+I impact. The Scope:Unchanged is correct (impact confined to the vulnerable application). |
| Affected versions | @fastify/aws-lambda < 6.4.1 (all 6.x, 5.x, 4.x, 3.x lines with decorateRequest enabled). Legacy aws-lambda-fastify 2.x (deprecated) also affected if still in use. |
| Fixed version | 6.4.1 (released 2024-08-03). The fix strips/overwrites client-supplied x-apigateway-event and x-apigateway-context headers before decoration. |
| Installed base | ~10,000 weekly npm downloads per npm/Socket.dev. Classified as "popular" within the npm registry but a narrow slice of the Lambda adapter market. 17 known downstream dependents. |
| Disclosure date | 2024-08-03 (coordinated with Fastify maintainers, fix released same day). |
| Reporter | Not publicly attributed. Disclosed via Fastify's GitHub Security Advisory process. |
noisgate verdict.
The single most decisive downgrade factor is the narrow installed base — ~10,000 weekly downloads and 17 dependents means the exposed population is a tiny fraction of Lambda workloads enterprise-wide. For the subset of applications that do use event-based authorization, the chain is trivial and the impact is complete auth bypass, which keeps this at HIGH rather than MEDIUM.
Why this verdict
- Unauthenticated remote, zero-click: The attack requires only sending an HTTP header — no credentials, no user interaction, no race conditions. This is the primary factor preventing a downgrade below HIGH.
- Narrow installed base caps real-world exposure: ~10K weekly npm downloads and 17 dependents. Compare to Express (30M+/week) or even serverless-http (200K+/week). Most enterprises running Lambda will not have this package in their dependency tree at all.
- Conditional exploitability: The application must specifically read
request.awsLambda.eventfor authorization decisions. Applications using independent JWT verification, Cognito middleware, or IAM-based auth are unaffected even if they run the vulnerable version. - Role multiplier:
@fastify/aws-lambdais application-tier software. It is not a hypervisor, IdP, domain controller, CI/CD system, or network edge appliance. The blast radius of a successful exploit is confined to the single Lambda-backed API — no lateral movement to other functions, AWS accounts, or infrastructure. This is a (b) typical-role component. No high-value-role floor applies. - Analogous precedent: The Hono framework's CVE-2026-27700 (GHSA-xh87-mx6m-69f3) was a structurally identical Lambda adapter header-trust bug rated HIGH 8.2. This CVE has a similar profile but narrower install base.
Why not higher?
CRITICAL would require either active exploitation (no KEV, no campaigns), a fleet-scale blast radius (this is per-application only), or a canonical high-value-role deployment (Lambda adapters are application-tier, not identity/infra components). The installed base of ~10K/week is too narrow to justify CRITICAL even though the mechanics are trivially exploitable.
Why not lower?
MEDIUM would understate the risk for the applications that *are* affected. The attack is unauthenticated, trivially weaponizable with curl, requires no special positioning, and results in complete authorization bypass. Any enterprise with this dependency in a production API that gates access on Lambda event data faces a real and immediate threat. The zero-friction exploit path keeps this firmly at HIGH.
What to do — in priority order.
- Deploy a WAF rule to strip or block the x-apigateway-event header from client requests — AWS WAF, Cloudflare, or any L7 WAF in front of API Gateway can drop requests containing the
x-apigateway-eventorx-apigateway-contextheaders. This neutralizes the spoofing vector without a code change. Deploy within 30 days per the noisgate mitigation SLA for HIGH. - Audit application code for event-based authorization patterns — Search your codebase for
request.awsLambda.event,request.headers['x-apigateway-event'], and any references torequestContext.authorizer. If the application does not use these for access control, the practical risk drops to negligible. Complete this audit within 30 days. - Migrate authorization to independent JWT validation — Instead of trusting the Lambda event's authorizer claims, validate JWTs directly using a library like
jsonwebtokenorjoseagainst your IdP's JWKS endpoint. This eliminates the entire class of event-spoofing attacks regardless of adapter version. - Upgrade to @fastify/aws-lambda >= 6.4.1 — The definitive fix. The patched version strips client-supplied event headers before populating the decorator. Apply within the 180-day noisgate remediation SLA for HIGH.
- API Gateway request validation — API Gateway validates request bodies and parameters but does NOT strip arbitrary HTTP headers. The
x-apigateway-eventheader passes through untouched. - Lambda function IAM policies — IAM controls which AWS APIs the function can call, not what HTTP headers reach the application code. This is orthogonal to the vulnerability.
- Network ACLs or Security Groups — The Lambda function runs in AWS-managed infrastructure. Network-layer controls do not filter HTTP header content.
Crowdsourced verification payload.
Run this on any machine with npm or node available. Point it at the directory containing your Lambda function's package.json. No special privileges required. Example: bash check_cve_2026_18248.sh /path/to/my-lambda-project
#!/usr/bin/env bash
# check_cve_2026_18248.sh — Detect CVE-2026-18248 in @fastify/aws-lambda
# Usage: bash check_cve_2026_18248.sh <project-directory>
# Exit codes: 0 = PATCHED/not present, 1 = VULNERABLE, 2 = UNKNOWN
set -euo pipefail
PROJECT_DIR="${1:-.}"
RESULT="UNKNOWN"
if [ ! -d "$PROJECT_DIR" ]; then
echo "ERROR: Directory $PROJECT_DIR does not exist"
exit 2
fi
# Check for the package in node_modules
PKG_JSON="$PROJECT_DIR/node_modules/@fastify/aws-lambda/package.json"
LEGACY_PKG_JSON="$PROJECT_DIR/node_modules/aws-lambda-fastify/package.json"
check_version() {
local pkg_file="$1"
local pkg_name="$2"
if [ ! -f "$pkg_file" ]; then
return 1
fi
VERSION=$(node -e "console.log(require('$pkg_file').version)" 2>/dev/null || echo "")
if [ -z "$VERSION" ]; then
echo "UNKNOWN — could not read version from $pkg_name"
exit 2
fi
echo "Found $pkg_name@$VERSION"
# Compare: vulnerable if < 6.4.1
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MINOR=$(echo "$VERSION" | cut -d. -f2)
PATCH=$(echo "$VERSION" | cut -d. -f3 | cut -d- -f1)
if [ "$MAJOR" -lt 6 ]; then
RESULT="VULNERABLE"
elif [ "$MAJOR" -eq 6 ] && [ "$MINOR" -lt 4 ]; then
RESULT="VULNERABLE"
elif [ "$MAJOR" -eq 6 ] && [ "$MINOR" -eq 4 ] && [ "$PATCH" -lt 1 ]; then
RESULT="VULNERABLE"
else
RESULT="PATCHED"
fi
return 0
}
if check_version "$PKG_JSON" "@fastify/aws-lambda"; then
: # version checked
elif check_version "$LEGACY_PKG_JSON" "aws-lambda-fastify"; then
echo "WARNING: Using deprecated aws-lambda-fastify package — all versions are VULNERABLE"
RESULT="VULNERABLE"
else
# Check package-lock.json or yarn.lock as fallback
if grep -q '@fastify/aws-lambda\|aws-lambda-fastify' "$PROJECT_DIR/package.json" 2>/dev/null; then
echo "UNKNOWN — package is listed as dependency but not installed. Run npm install first."
exit 2
else
echo "PATCHED — @fastify/aws-lambda is not a dependency of this project"
exit 0
fi
fi
echo "$RESULT"
if [ "$RESULT" = "VULNERABLE" ]; then
echo "ACTION: Upgrade to @fastify/aws-lambda >= 6.4.1"
exit 1
elif [ "$RESULT" = "PATCHED" ]; then
exit 0
else
exit 2
fiIf you remember one thing.
@fastify/aws-lambda in production, audit your dependency tree this week — run npm ls @fastify/aws-lambda across all Lambda projects. For any project on a version below 6.4.1 that uses request.awsLambda.event for authorization, deploy a WAF rule to strip the x-apigateway-event header from client requests within the noisgate mitigation SLA of 30 days. Upgrade to @fastify/[email protected]+ within the noisgate remediation SLA of 180 days. If your Lambda APIs do not read event data for auth decisions (verify by grepping for awsLambda.event and x-apigateway-event), the practical risk is negligible — but upgrade anyway during your next dependency refresh cycle.Sources
- Fastify aws-lambda-fastify GitHub repository
- @fastify/aws-lambda npm package
- Hono CVE-2026-27700 — analogous Lambda adapter header spoofing (GHSA-xh87-mx6m-69f3)
- aws-lambda-fastify releases and changelogs
- Fastify aws-lambda-fastify architecture — DeepWiki
- Socket.dev — @fastify/aws-lambda package overview
- FIRST EPSS API
What defenders are saying.
Crowdsourced verification outputs.
Results submitted by users who ran the verification payload against their environment.