Vulnerability library
Security checkMay 12, 2026

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

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

High severitynpmprotobufjs

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

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.

Recommendation

Update the protobufjs package to the latest compatible version. Followings are version details:

  • Affected version(s): **>= 8.0.0, <= 8.0.1 <= 7.5.5**
  • Patched version(s): **8.0.2 7.5.6**

References

Could your website be exposed too?

SmartScanner can check your website for protobuf.js: Code injection through bytes field defaults in generated toObject code and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated May 12, 2026