Vulnerabilities in pkg:pypi/sentencepiece

PACKAGE
Advisory Identifier: GHSA-38vq-g6vr-w8wf
Advisory Summary

CVE-2026-1260 is a HIGH sentencepiece has a a heap vulnerability (CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer) affecting Sentencepiece libraries in the PyPI ecosystem. The issue involves sentencepiece has a a heap overflow issue. Remediation is available by upgrading affected packages to version 0.2.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/sentencepiece

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/sentencepiece. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-38vq-g6vr-w8wf CVE-2026-1260 HIGH Sentencepiece has a a heap overflow issue

CVE-2026-1260 at a Glance

CVE Identifier CVE-2026-1260
GHSA Identifier GHSA-38vq-g6vr-w8wf
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer
Affected Product Sentencepiece
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-1260

To remediate this vulnerability, upgrade all affected Sentencepiece dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

sentencepiece fixed: 0.2.1
pip install sentencepiece>=0.2.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show sentencepiece

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-1260, inspect your installed packages using pip:

pip show sentencepiece

Analyze the terminal output to locate any version of Sentencepiece in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.2.1), your application is affected.

Note: The pip show sentencepiece command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer, where the product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. this may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data. In Sentencepiece, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Invalid memory access in Sentencepiece versions less than 0.2.1 when using a vulnerable model file, which is not created in the normal training procedure.

CVE-2026-1260 Affected Sentencepiece Versions

1 component(s)
Fixed Versions:
0.2.1
Product / Package Ecosystem Affected Versions Fixed Version
sentencepiece
PyPI
< 0.2.1
0.2.1

References

Frequently Asked Questions

What is CVE-2026-1260?
CVE-2026-1260 is a security vulnerability in Sentencepiece involving Sentencepiece has a a heap overflow issue under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer.
Which Sentencepiece versions are affected?
Affected versions include releases prior to 0.2.1 across affected packages: sentencepiece.
What version fixes CVE-2026-1260?
Upgrading to 0.2.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sentencepiece affected?
Yes, sentencepiece is affected in releases prior to 0.2.1. Upgrade your dependency to 0.2.1 or later.
What CWE is associated with CVE-2026-1260?
CVE-2026-1260 is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer (The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.).
How can I check PyPI dependencies for CVE-2026-1260?
Run the dependency tree command: 'pip show sentencepiece'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-38vq-g6vr-w8wf",
  "modified" : "2026-01-22T20:28:39Z",
  "published" : "2026-01-22T18:30:39Z",
  "aliases" : [ "CVE-2026-1260" ],
  "summary" : "Sentencepiece has a a heap overflow issue",
  "details" : "Invalid memory access in Sentencepiece versions less than 0.2.1 when using a vulnerable model file, which is not created in the normal training procedure.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "sentencepiece"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.2.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-1260"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/sentencepiece/commit/d856b67fdb3492e035489abf9b3aaf486144b2c0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/google/sentencepiece"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/google/sentencepiece/releases/tag/v0.2.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-119" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-22T20:28:39Z",
    "nvd_published_at" : "2026-01-22T17:16:30Z"
  }
}