CVE-2022-31005
Swift vulnerability analysis and mitigation

Overview

Vapor, an HTTP web framework for Swift, contained a vulnerability (CVE-2022-31005) in versions prior to 4.60.3 that affected users with FileMiddleware enabled. The vulnerability was discovered and disclosed on May 31, 2022, and allowed attackers to cause a Denial of Service (DoS) attack through invalid range headers (GitHub Advisory).

Technical details

The vulnerability was caused by insufficient validation of HTTP Range request headers in the FileMiddleware component. When processing range headers like '0-9223372036854775807', the application would experience an integer overflow condition, leading to a crash. The issue specifically occurred in the handling of byte range requests for file downloads (GitHub Advisory).

Impact

When exploited, this vulnerability could cause a Denial of Service condition by crashing applications that use Vapor's FileMiddleware. Any application with FileMiddleware enabled was vulnerable to this attack, potentially affecting service availability (GitHub Advisory).

Mitigation and workarounds

The vulnerability was patched in Vapor version 4.60.3. Users are strongly recommended to upgrade to this version or later. As a temporary workaround, users can disable FileMiddleware and serve static files via a CDN instead (GitHub Release, GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Swift vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-54951CRITICAL9.8
  • JavaJava
  • executorch
NoYesAug 07, 2025
GHSA-88q6-jcjg-hvmwHIGH8.8
  • SwiftSwift
  • github.com/beatt83/jose-swift
NoNoJan 09, 2026
GHSA-xvr7-p2c6-j83wMEDIUM6.3
  • SwiftSwift
  • github.com/apple/swift-nio-http2
NoYesAug 13, 2025
CVE-2026-23886MEDIUM5.3
  • SwiftSwift
  • github.com/swift-otel/swift-otel
NoYesJan 19, 2026
GHSA-pc9j-5v36-2mwwLOW3.7
  • SwiftSwift
  • github.com/awslabs/aws-sdk-swift
NoYesJan 08, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management