GHSA-f86p-h4j2-7qgj: XSS

Published Oct 28, 2026
·
Updated

Summary

seroval writes a typed array as a call to its constructor. In affected versions, the constructor name in the output is read from a property that data on the value can replace, and it is written without checks. A typed array that received properties from untrusted data can then put arbitrary code into the serialized output.

Details

Version 1.6.0 changed how seroval finds the class of an object, so that objects with their own constructor property serialize correctly. Typed arrays still took the constructor name from the value itself, so the name could come from the untrusted property instead of the array's real type.

These functions are affected:

- serialize, serializeAsync - crossSerialize, crossSerializeAsync, crossSerializeStream - the Serializer class - compileJSON

fromJSON and fromCrossJSON are not affected: they only accept the names of the built-in typed arrays. With the compactArrayBufferViews option, the same lookup throws a TypeError instead of writing code.

Impact

An application is affected only when it serializes a typed array that has an own constructor property set from untrusted data. That requires code that copies properties from untrusted objects onto a typed array. This is unusual, so the severity is rated Low, even though the result is script execution in the page that receives the output.

Patches

Fixed in 1.6.11. The constructor name now comes from the array's internal type, which properties on the value cannot change. compactArrayBufferViews uses the real type as well.

Workarounds

If you cannot upgrade, do not copy properties from untrusted objects onto typed arrays, or remove an own constructor property from a typed array before serializing it.

Affected Software

1 affected componentFixes available
npm/seroval>=1.6.0<1.6.11
1.6.11

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/seroval to a version that resolves this vulnerability.

    Fixed in 1.6.11
  2. Upgrade

    Upgrade seroval to a version that resolves this vulnerability.

    Fixed in 1.6.11
  3. Compensating control

    If you cannot upgrade, do not copy properties from untrusted objects onto typed arrays, or remove an own constructor property from a typed array before serializing it.

Event History

Oct 28, 2026
Advisory Published
via GitHub·09:17 PM
Data Sourced
via GitHub·09:17 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which seroval interfaces are affected?

The affected interfaces are serialize, serializeAsync, crossSerialize, crossSerializeAsync, crossSerializeStream, the Serializer class, and compileJSON.

2

What conditions are required for exploitation?

The application must serialize a typed array with an own constructor property that was set from untrusted data. This requires application code that copies properties from untrusted input onto a typed array or otherwise permits that property to be set.

3

Does enabling compactArrayBufferViews prevent code being written to serialized output?

With compactArrayBufferViews enabled, the affected constructor lookup throws a TypeError rather than writing code. This changes the issue from code injection during serialization to an error condition for the affected input.

4

Are JSON deserialization functions affected?

No. fromJSON and fromCrossJSON are not affected because they accept only the names of built-in typed arrays.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203