CVE-2024-24785: Errors returned from JSON marshaling may break template escaping in html/template

Published Mar 5, 2024
·
Updated

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

Other sources

Golang Go could allow a remote attacker to bypass security restrictions, caused by a flaw in the MarshalJSON methods in the html/template package. By sending a specially crafted request, an attacker could exploit this vulnerability to inject unexpected content into templates.

IBM

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://github.com/golang/go/issues/65697

Red Hat

Affected Software

8 affected componentsFixes available
debian/golang-1.15<=1.15.15-1~deb11u4
debian/golang-1.19<=1.19.8-2
IBM Concert Software<=1.0.0, 1.0.1, 1.0.2, 1.0.2.1
redhat/go<1.21.8
1.21.8
redhat/go<1.22.1
1.22.1
Microsoft cbl2 golang 1.18.8-7
Microsoft cbl2 golang 1.17.13-2
Microsoft cbl2 golang 1.21.6-1

Event History

Mar 5, 2024
CVE Published
via MITRE·10:22 PM
Data Sourced
via MITRE·10:22 PM
DescriptionWeakness
Data Sourced
via NVD·11:15 PM
DescriptionSeverity
Mar 6, 2024
Data Sourced
via Red Hat·02:11 AM
DescriptionSeverityAffected Software
Jul 9, 2024
Data Sourced
via Launchpad·03:35 PM
Description
Nov 15, 2024
Data Sourced
via Ubuntu·01:20 PM
RemedyDescriptionSeverityAffected Software
Nov 19, 2024
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
Sep 4, 2025
Data Sourced
via Microsoft·07:47 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:47 AM
Affected Software
Updated
via Microsoft·07:47 AM
Description
Updated
via Microsoft·07:47 AM
DescriptionSeverity

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-24785?

CVE-2024-24785 is considered a medium severity vulnerability due to the potential for remote exploitation.

2

How do I fix CVE-2024-24785?

To fix CVE-2024-24785, update to the appropriate versions of Go or affected software as detailed in the remediation section.

3

What systems are affected by CVE-2024-24785?

CVE-2024-24785 affects IBM Concert Software versions up to 1.0.2.1 and several versions of Golang packages across different distributions.

4

What type of vulnerability is CVE-2024-24785?

CVE-2024-24785 is a remote code execution vulnerability due to improper handling of JSON marshaling in the html/template package.

5

Can CVE-2024-24785 lead to further attacks?

Yes, if exploited, CVE-2024-24785 could allow attackers to inject malicious content into templates, potentially leading to further attacks.

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