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 Your last release was probably never penetration tested 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 and retrieve results in a structured manner. The Rows.Scan method is used to read data from a query result into variables. However, this package is susceptible to race conditions when queries are cancelled during the scanning process, leading to unexpected results.

Vulnerability Detail

The vulnerability arises when a query is cancelled while the Rows.Scan method is being executed. If multiple queries are running in parallel, this can lead to a race condition where the results of one query may overwrite the expected results of another. This can cause the Scan method to return incorrect data or even trigger an error, compromising the integrity of the application's data handling.

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, avoid cancelling queries while the Rows.Scan method is in progress. Ensure that all queries are completed before attempting to cancel any ongoing operations. Additionally, consider implementing synchronization mechanisms to manage concurrent queries more effectively.

Conclusion

CVE-2025-47907 presents a significant risk to applications using the Go standard library's database/sql package. By understanding the nature of this vulnerability and applying the recommended fixes or workarounds, developers can safeguard their applications against potential data integrity issues.

See every vulnerability recorded for stdlib →

Share this vulnerability

FAQ

CVE-2025-47907 is a vulnerability in the Go standard library's database/sql package that can lead to race conditions when cancelling queries during the Rows.Scan method.

This vulnerability can cause your application to return incorrect results or errors when executing SQL queries, potentially leading to data integrity issues.

The vulnerability affects versions prior to 1.23.12 and 1.24.0, specifically those before 1.24.6.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.

If an immediate update is not possible, implement workarounds such as avoiding query cancellations during scanning and using synchronization to manage concurrent queries.

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