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.
https://security.netapp.com/advisory/ntap-20240329-0008/
https://pkg.go.dev/vuln/GO-2024-2610