CVE-2025-47907: Go stdlib database/sql Rows.Scan Race Condition Vulnerability

stdlib Updated 02 Oct 2025

Summary

07/08/2025
Yes i
Unrated
Not published

CVE-2025-47907: Incorrect results returned from Rows.Scan in database/sql. Affects stdlib across 2 version ranges.

< 1.23.12 >= 1.24.0, < 1.24.6

Fixed in 1.23.12 or 1.24.6, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2025-47907 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The Go standard library's database/sql package provides a generic interface for interacting with SQL databases. It allows developers to execute queries, retrieve results, and manage database connections efficiently. The package is widely used in Go applications for its simplicity and effectiveness in handling SQL operations. However, it is susceptible to a race condition vulnerability that can lead to unexpected results when multiple queries are executed in parallel.

Vulnerability Detail

The vulnerability arises when a query is cancelled during the execution of the Scan method on the returned Rows. If multiple queries are being processed simultaneously, cancelling one query can inadvertently overwrite the results of another query. This race condition can lead to either unexpected results being returned from the Scan method or an error, compromising the integrity of the data retrieved from the database.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.23.12 1.23.12
    go get stdlib@v1.23.12
  • >= 1.24.0, < 1.24.6 1.24.6
    go get stdlib@v1.24.6

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, ensure that queries are not cancelled while the Scan method is being executed. This can be achieved by managing the context carefully and avoiding concurrent executions of queries that may interfere with each other.

Conclusion

The CVE-2025-47907 vulnerability in the Go standard library's database/sql package poses a significant risk due to race conditions during query execution. It is crucial for developers to update their Go installations to the latest patched versions to mitigate this risk and ensure data integrity.

See every vulnerability recorded for stdlib →

Share this vulnerability

FAQ

The impact includes the potential for incorrect data being returned from database queries, which can lead to application errors and data integrity issues.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The affected versions are from 0 up to 1.23.12 and from 1.24.0 up to 1.24.6.

Yes, updating to the patched versions of the Go standard library will resolve this vulnerability.

If immediate updates are not possible, implement careful context management to avoid cancelling queries while scanning results.

Related vulnerabilities

Recent vulnerabilities recorded for stdlib.

How To Fix

Latest published version: go1.25.5 as of 22 Oct 2026

go get stdlib@vgo1.25.5

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 1.23.12 1.23.12
    go get stdlib@v1.23.12
  • >= 1.24.0, < 1.24.6 1.24.6
    go get stdlib@v1.24.6

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback