CVE-2020-25614: Denial of service in github.com/antchfx/xmlquery

github.com/antchfx/xmlquery Updated 02 Oct 2025

Summary

14/04/2021
Yes i
High
7.5

CVE-2020-25614: Denial of service in github.com/antchfx/xmlquery. Affects github.com/antchfx/xmlquery versions < 1.3.1. Fixed in 1.3.1. How to fix ↓

Also tracked for

The same CVE-2020-25614 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The package github.com/antchfx/xmlquery is a Go library that provides a simple and efficient way to parse and query XML documents. It is widely used in Go applications for XML processing tasks. However, a vulnerability has been discovered in the package that can lead to a denial of service (DoS) attack.

Vulnerability Detail

The vulnerability in github.com/antchfx/xmlquery, identified as CVE-2020-25614, arises from the LoadURL function not properly checking the Content-Type of loaded resources. This can result in a panic due to a nil pointer dereference if the loaded resource is not XML. An attacker can exploit this by supplying malicious URLs, causing the application to crash and become unresponsive. This vulnerability poses a significant risk as it can be used as a vector for denial of service attacks.

How To Fix

Minimum fixed version

1.3.1

This is the first release that contains the fix.

go get github.com/antchfx/xmlquery@v1.3.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, developers can implement their own validation of the Content-Type before passing URLs to the LoadURL function. This can be done by using the net/http package to make a HEAD request to the URL and checking the Content-Type header. If the Content-Type is not XML, the URL should not be passed to the LoadURL function. Here is an example of how this can be done in Go:

import (
	"net/http"
	"strings"
)

func validateURL(url string) bool {
	resp, err := http.Head(url)
	if err != nil {
		return false
	}
	contentType := resp.Header.Get("Content-Type")
	return strings.Contains(contentType, "xml")
}

By implementing this workaround, developers can mitigate the risk of the vulnerability until they are able to update to the fixed version of the package.

Conclusion

The vulnerability identified as CVE-2020-25614 in the github.com/antchfx/xmlquery package can lead to a denial of service attack. It is crucial for developers to update their applications to use version 1.3.1 or later of the package, which includes a fix for the vulnerability. In the meantime, a temporary workaround can be implemented to validate the Content-Type of URLs before passing them to the LoadURL function. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/antchfx/xmlquery →

Share this vulnerability

FAQ

This vulnerability can be used by attackers to launch denial of service attacks against applications that use the github.com/antchfx/xmlquery package. By supplying malicious URLs, an attacker can cause the application to crash and become unresponsive, leading to service disruption.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply enter your Gopkg.lock file and the playground will analyze it for any open-source vulnerabilities, including CVE-2020-25614.

At the time of this report, there are no known public exploits specifically targeting this vulnerability. However, it is important to promptly update the affected package to mitigate the risk of potential attacks.

Yes, a fix for this vulnerability is available in version 1.3.1 of the github.com/antchfx/xmlquery package. It is recommended to update to this version or later to ensure the vulnerability is addressed.

Yes, a temporary workaround is available by implementing custom validation of the Content-Type before passing URLs to the LoadURL function. This can help mitigate the risk of the vulnerability until the package can be updated.

How To Fix

Minimum fixed version

1.3.1

This is the first release that contains the fix.

go get github.com/antchfx/xmlquery@v1.3.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback