High

protobuf.js: Code injection through bytes field defaults in generated toObject code

  • Disclosed: 12.05.2026
  • Updated: 11.10.2026 10:22

Summary

protobufjs generated JavaScript for toObject conversion could include an unsafe expression derived from a schema-controlled bytes field default value. A crafted descriptor with a non-string default value for a bytes field could cause attacker-controlled code to be emitted into the generated conversion function.

Impact

An attacker who can provide or influence a protobuf descriptor may be able to execute arbitrary JavaScript in the context of the process using protobufjs.

This requires the application to load an attacker-controlled schema or descriptor and then convert a message of the affected type with defaults enabled. Applications that only use trusted, application-defined schemas are not directly affected by this issue.

Preconditions

  • The application must allow an attacker to control or influence a protobuf JSON descriptor or equivalent reflected schema.
  • The descriptor must define a bytes field with an attacker-controlled default value.
  • The application must call toObject with defaults enabled for the affected type.

Workarounds

Do not load protobuf schemas or JSON descriptors from untrusted sources with affected versions. If untrusted schemas must be accepted, validate or restrict field options before loading them and run schema processing in an isolated environment.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package protobufjs < 7.5.6, >= 8.0.0, < 8.0.2 7.5.6, 8.0.2

References

CVSS score -
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Weakness (CWE)
CWE-94
Platform
npm
Package
protobufjs
Disclosed
12.05.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-66ff-xgx4-vchm - CC BY 4.0

Vulnerability history: protobufjs

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (17) in the archive
Total entries
17
First → latest
10.2018 07.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Critical 2
  • High 6
  • Medium 9

Disclosures per year

  1. 2018: 1
  2. 2019: 0
  3. 2020: 0
  4. 2021: 0
  5. 2022: 1
  6. 2023: 1
  7. 2024: 0
  8. 2025: 0
  9. 2026: 14
Severity:
  1. High · 7.5 CVE-2026-48712 < 7.6.1, >= 8.0.0, < 8.4.1 7.6.1, 8.4.1
  2. protobuf.js: Code injection through bytes field defaults in generated toObject code this entry
    High CVE-2026-44293 < 7.5.6, >= 8.0.0, < 8.0.2 7.5.6, 8.0.2
  3. High · 8.1 CVE-2026-44291 < 7.5.6, >= 8.0.0, < 8.0.2 7.5.6, 8.0.2
  4. High · 7.5 CVE-2026-44290 < 7.5.6, >= 8.0.0, < 8.0.2 7.5.6, 8.0.2
  5. High · 7.5 CVE-2026-44289 < 7.5.6, >= 8.0.0, < 8.0.2 7.5.6, 8.0.2
  6. Critical · 9.8 CVE-2026-41242 >= 8.0.0, < 8.0.1, < 7.5.5 8.0.1, 7.5.5
  7. Critical · 9.8 CVE-2023-36665 >= 7.0.0, < 7.2.5, >= 6.10.0, < 6.11.4 7.2.5, 6.11.4
  8. High · 7.5 CVE-2022-25878 >= 6.11.0, < 6.11.3, >= 6.10.0, < 6.10.3 6.11.3, 6.10.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.