VDB
Sign up
MEDIUM5.4

GO-2024-2610

Errors returned from JSON marshaling may break template escaping in html/template

Quick fix

GO-2024-2610 — stdlib: upgrade to the fixed version with the command below.

go get stdlib@v1.21.8

Details

If errors returned from MarshalJSON methods contain user controlled data, they may be used to break the contextual auto-escaping behavior of the html/template package, allowing for subsequent actions to inject unexpected content into templates.

Are you affected?

Enter the version of the package you're using.

Affected packages

Go/stdlib
Introduced in: 0Fixed in: 1.21.8
Fixgo get stdlib@v1.21.8

References