VaporApplication · Vapor Project

CVE-2021-32742

CRITICAL · 9.1 CVSS v3.1 Published 2021-07-09
Fix available
A fix is available. Upgrade to 4.47.2 or later.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
Vapor is a web framework for Swift. In versions 4.47.1 and prior, bug in the `Data.init(base32Encoded:)` function opens up the potential for exposing server memory and/or crashing the server (Denial of Service) for applications where untrusted data can end up in said function. Vapor does not currently use this function itself so this only impact applications that use the impacted function directly or through other dependencies. The vulnerability is patched in version 4.47.2. As a workaround, one may use an alternative to Vapor's built-in `Data.init(base32Encoded:)`.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Vapor's custom implementation of Data.init(base32Encoded:) contains a memory handling bug that allows attackers to either read arbitrary server memory contents or crash the server (DoS) by supplying crafted base32-encoded input. This affects applications using this function directly or indirectly through dependencies.

MitigationUpgrade Vapor to version 4.47.2 or later, or replace all uses of Vapor's Data.init(base32Encoded:) with Swift's native implementation or a third-party base32 library.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
VaporApplication
Affected:< 4.47.2

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify Vapor as a dependency
    Review your project's Package.swift or dependency manifest file for 'vapor' or 'vapor' package dependency, or check your project's installed packages list
    Affected if Vapor appears as a direct or transitive dependency in your project
  2. Check installed Vapor version
    Run 'swift package show-dependencies' or check your lock file (Package.resolved) to find the exact version of Vapor currently installed
    Affected if The installed version is lower than 4.47.2 (e.g., 4.47.1, 4.47.0, or any 4.x version below 4.47.2)
  3. Search for base32 decode usage
    Search your codebase for calls to 'Data(base32Encoded:)', 'init(base32Encoded:)', or imports of base32-related functionality from Vapor
    Affected if Your code or any dependency uses Vapor's custom Data.init(base32Encoded:) implementation
  4. Identify input sources for base32 decoding
    Review where base32-encoded data enters your application (HTTP parameters, file uploads, API payloads, database fields) and trace if it reaches Vapor's base32 decoder
    Affected if User-controlled or external input can reach the vulnerable Data.init(base32Encoded:) function

You are affected if your project uses Vapor version lower than 4.47.2 and any external or user-supplied data flows through Vapor's custom Data.init(base32Encoded:) method.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 4.47.2 or later
Fixed in 4.47.2
Interim mitigation

Upgrade Vapor to version 4.47.2 or later, or replace all uses of Vapor's Data.init(base32Encoded:) with Swift's native implementation or a third-party base32 library.

Recommended fix High confidence

Vapor 4.47.2 or later

  1. Identify your current Vapor version in your Package.swift file
  2. Update the Vapor dependency in Package.swift to version 4.47.2 or later (e.g., from ".upToNextMinor" to ".upToNextMajor" or directly specify "4.47.2")
  3. Run 'swift package update' to fetch the updated dependencies
  4. Rebuild your application with 'swift build'
  5. Test that your application handles base32-encoded data correctly and does not crash
  6. Verify that server memory is not being exposed through base32 decoding
Caveat Check Vapor's release notes between your current version and 4.47.2 for any breaking changes; minor version bumps typically have minimal breaking changes

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Vapor Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing6.0 h
  • Review / QA2.0 h
14.0 hours of engineering $2,380
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,808.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2021-32742 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2021-32742 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data