← Back to Feed CACHED · 2026-08-03 15:40:39 · CACHE_KEY CVE-2026-18248
CVE-2026-18248 · CWE-345 · Disclosed 2024-08-03

@fastify/aws-lambda vulnerable to Lambda event spoofing via client-controlled x-apigateway-event header

ASSESSED — NOISGATE V0.5
Vendor
Reassessed
Verdict:
Do you agree?
01 · The Real Story

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.

"Auth bypass via header spoofing in a niche Lambda adapter — serious but narrow blast radius."
02 · The Attack Path

4 steps from start to impact.

STEP 01

Identify a Lambda API using @fastify/aws-lambda

The attacker discovers a public API endpoint backed by AWS Lambda and API Gateway (or ALB). Standard reconnaissance — response headers, error messages, or stack traces — may reveal the Fastify framework. The presence of @fastify/aws-lambda is inferred from behavior or disclosed in package-lock.json leaks.
Conditions required:
  • Target API is publicly accessible via API Gateway or ALB
  • Target uses @fastify/aws-lambda < 6.4.1
Where this breaks in practice:
  • 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
STEP 02

Craft a spoofed x-apigateway-event header

The attacker constructs a URL-encoded JSON payload mimicking a legitimate API Gateway event object. This includes forged 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.
Conditions required:
  • No prerequisite — any HTTP client (curl, Burp Suite, custom script) suffices
Where this breaks in practice:
  • 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
Detection/coverage: WAF rules inspecting for x-apigateway-event in client requests would flag this. No standard scanner checks for this pattern today.
STEP 03

Application trusts the spoofed event data

The vulnerable version of @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.
Conditions required:
  • Application reads request.awsLambda.event or the raw header for authorization decisions
  • decorateRequest option is enabled (it is by default)
Where this breaks in practice:
  • 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
STEP 04

Authorization bypass and data exfiltration

With forged identity claims, the attacker accesses resources belonging to other users or tenants, escalates privileges within the application, or exfiltrates data. The impact depends entirely on what the application gates behind event-based authorization: it could range from reading another user's profile to accessing admin endpoints or cross-tenant data.
Conditions required:
  • Application uses event data as a trust boundary for authorization
Where this breaks in practice:
  • Blast radius is limited to the single application; no lateral movement to other Lambda functions or AWS infrastructure
Detection/coverage: Application-level audit logs may show anomalous access patterns. CloudTrail logs the Lambda invocation but not the HTTP header content.
03 · Intelligence Metadata

The supporting signals.

In-the-wild exploitationNo known active exploitation. Not listed on CISA KEV. No reports from threat intelligence feeds as of 2026-08-03.
Proof-of-conceptTrivial 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.
EPSSNot yet scored — FIRST EPSS API returns no data for this CVE as of 2026-08-03. Likely too new for model ingestion.
KEV statusNot listed. No CISA KEV entry.
CVSS vectorCVSS: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 version6.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 date2024-08-03 (coordinated with Fastify maintainers, fix released same day).
ReporterNot publicly attributed. Disclosed via Fastify's GitHub Security Advisory process.
04 · The Call

noisgate verdict.

Final Verdict
DOWNGRADED to HIGH (7.5/10)

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.

HIGH Vulnerability mechanics and exploitability
MEDIUM Real-world prevalence of event-based auth patterns in @fastify/aws-lambda apps
LOW EPSS and exploitation telemetry (no data available yet)

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.event for 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-lambda is 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.

05 · Compensating Control

What to do — in priority order.

  1. 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-event or x-apigateway-context headers. This neutralizes the spoofing vector without a code change. Deploy within 30 days per the noisgate mitigation SLA for HIGH.
  2. Audit application code for event-based authorization patterns — Search your codebase for request.awsLambda.event, request.headers['x-apigateway-event'], and any references to requestContext.authorizer. If the application does not use these for access control, the practical risk drops to negligible. Complete this audit within 30 days.
  3. Migrate authorization to independent JWT validation — Instead of trusting the Lambda event's authorizer claims, validate JWTs directly using a library like jsonwebtoken or jose against your IdP's JWKS endpoint. This eliminates the entire class of event-spoofing attacks regardless of adapter version.
  4. 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.
What doesn't work
  • API Gateway request validation — API Gateway validates request bodies and parameters but does NOT strip arbitrary HTTP headers. The x-apigateway-event header 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.
06 · Verification

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

noisgate-verify.sh
BASHREAD-ONLYSAFE
#!/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
fi
07 · Bottom Line

If you remember one thing.

TL;DR
If you run @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

  1. Fastify aws-lambda-fastify GitHub repository
  2. @fastify/aws-lambda npm package
  3. Hono CVE-2026-27700 — analogous Lambda adapter header spoofing (GHSA-xh87-mx6m-69f3)
  4. aws-lambda-fastify releases and changelogs
  5. Fastify aws-lambda-fastify architecture — DeepWiki
  6. Socket.dev — @fastify/aws-lambda package overview
  7. FIRST EPSS API
Peer Review

What defenders are saying.

Submit a review attribution: handle + country only
0 flags selected · stored anonymously
Validation Results

Crowdsourced verification outputs.

Results submitted by users who ran the verification payload against their environment.