stdlib 1.16 (golang)
pkg:golang/stdlib@1.16

| Affected range | <1.21.11 | | Fixed version | 1.21.11 | | EPSS Score | 0.082% | | EPSS Percentile | 24th percentile |
Description
The various Is methods (IsPrivate, IsLoopback, etc) did not work as expected for IPv4-mapped IPv6 addresses, returning false for addresses which would return true in their traditional IPv4 forms.

| Affected range | <1.19.9 | | Fixed version | 1.19.9 | | EPSS Score | 0.250% | | EPSS Percentile | 48th percentile |
Description
Not all valid JavaScript whitespace characters are considered to be whitespace. Templates containing whitespace characters outside of the character set "\t\n\f\r\u0020\u2028\u2029" in JavaScript contexts that also contain actions may not be properly sanitized during execution.

| Affected range | <1.19.8 | | Fixed version | 1.19.8 | | EPSS Score | 0.664% | | EPSS Percentile | 70th percentile |
Description
Templates do not properly consider backticks (`) as Javascript string delimiters, and do not escape them as expected.
Backticks are used, since ES6, for JS template literals. If a template contains a Go template action within a Javascript template literal, the contents of the action can be used to terminate the literal, injecting arbitrary Javascript code into the Go template.
As ES6 template literals are rather complex, and themselves can do string interpolation, the decision was made to simply disallow Go template actions from being used inside of them (e.g. "var a = {{.}}"), since there is no obviously safe way to allow this behavior. This takes the same approach as github.com/google/safehtml.
With fix, Template.Parse returns an Error when it encounters templates like this, with an ErrorCode of value 12. This ErrorCode is currently unexported, but will be exported in the release of Go 1.21.
Users who rely on the previous behavior can re-enable it using the GODEBUG flag jstmpllitinterp=1, with the caveat that backticks will now be escaped. This should be used with caution.

| Affected range | <1.23.8 | | Fixed version | 1.23.8 | | EPSS Score | 0.019% | | EPSS Percentile | 4th percentile |
Description
The net/http package improperly accepts a bare LF as a line terminator in chunked data chunk-size lines. This can permit request smuggling if a net/http server is used in conjunction with a server that incorrectly accepts a bare LF as part of a chunk-ext.

| Affected range | <1.16.14 | | Fixed version | 1.16.14 | | EPSS Score | 0.024% | | EPSS Percentile | 6th percentile |
Description
Some big.Int values that are not valid field elements (negative or overflowing) might cause Curve.IsOnCurve to incorrectly return true. Operating on those values may cause a panic or an invalid curve operation. Note that Unmarshal will never return such values.

| Affected range | <1.19.10 | | Fixed version | 1.19.10 | | EPSS Score | 0.009% | | EPSS Percentile | 1st percentile |
Description
On Unix platforms, the Go runtime does not behave differently when a binary is run with the setuid/setgid bits. This can be dangerous in certain cases, such as when dumping memory state, or assuming the status of standard i/o file descriptors.
If a setuid/setgid binary is executed with standard I/O file descriptors closed, opening any files can result in unexpected content being read or written with elevated privileges. Similarly, if a setuid/setgid program is terminated, either via panic or signal, it may leak the contents of its registers.

| Affected range | <1.17.11 | | Fixed version | 1.17.11 | | EPSS Score | 0.026% | | EPSS Percentile | 7th percentile |
Description
On Windows, executing Cmd.Run, Cmd.Start, Cmd.Output, or Cmd.CombinedOutput when Cmd.Path is unset will unintentionally trigger execution of any binaries in the working directory named either "..com" or "..exe".

| Affected range | <1.24.11 | | Fixed version | 1.24.11 | | EPSS Score | 0.016% | | EPSS Percentile | 3rd percentile |
Description
Within HostnameError.Error(), when constructing an error string, there is no limit to the number of hosts that will be printed out. Furthermore, the error string is constructed by repeated string concatenation, leading to quadratic runtime. Therefore, a certificate provided by a malicious actor can result in excessive resource consumption.

| Affected range | <1.24.8 | | Fixed version | 1.24.8 | | EPSS Score | 0.026% | | EPSS Percentile | 6th percentile |
Description
The ParseAddress function constructs domain-literal address components through repeated string concatenation. When parsing large domain-literal components, this can cause excessive CPU consumption.

| Affected range | <1.24.8 | | Fixed version | 1.24.8 | | EPSS Score | 0.026% | | EPSS Percentile | 6th percentile |
Description
The processing time for parsing some invalid inputs scales non-linearly with respect to the size of the input.
This affects programs which parse untrusted PEM inputs.

| Affected range | <1.24.8 | | Fixed version | 1.24.8 | | EPSS Score | 0.014% | | EPSS Percentile | 2nd percentile |
Description
Validating certificate chains which contain DSA public keys can cause programs to panic, due to a interface cast that assumes they implement the Equal method.
This affects programs which validate arbitrary certificate chains.

| Affected range | <1.24.9 | | Fixed version | 1.24.9 | | EPSS Score | 0.015% | | EPSS Percentile | 3rd percentile |
Description
Due to the design of the name constraint checking algorithm, the processing time of some inputs scale non-linearly with respect to the size of the certificate.
This affects programs which validate arbitrary certificate chains.

| Affected range | <1.22.7 | | Fixed version | 1.22.7 | | EPSS Score | 0.147% | | EPSS Percentile | 36th percentile |
Description
Calling Parse on a "// +build" build tag line with deeply nested expressions can cause a panic due to stack exhaustion.

| Affected range | <1.22.7 | | Fixed version | 1.22.7 | | EPSS Score | 0.298% | | EPSS Percentile | 53rd percentile |
Description
Calling Decoder.Decode on a message which contains deeply nested structures can cause a panic due to stack exhaustion. This is a follow-up to CVE-2022-30635.

| Affected range | <1.21.12 | | Fixed version | 1.21.12 | | EPSS Score | 0.618% | | EPSS Percentile | 69th percentile |
Description
The net/http HTTP/1.1 client mishandled the case where a server responds to a request with an "Expect: 100-continue" header with a non-informational (200 or higher) status. This mishandling could leave a client connection in an invalid state, where the next request sent on the connection will fail.
An attacker sending a request to a net/http/httputil.ReverseProxy proxy can exploit this mishandling to cause a denial of service by sending "Expect: 100-continue" requests which elicit a non-informational response from the backend. Each such request leaves the proxy with an invalid connection, and causes one subsequent request using that connection to fail.

| Affected range | <1.21.8 | | Fixed version | 1.21.8 | | EPSS Score | 1.498% | | EPSS Percentile | 81st percentile |
Description
The ParseAddressList function incorrectly handles comments (text within parentheses) within display names. Since this is a misalignment with conforming address parsers, it can result in different trust decisions being made by programs using different parsers.

| Affected range | <1.21.9 | | Fixed version | 1.21.9 | | EPSS Score | 66.635% | | EPSS Percentile | 98th percentile |
Description
An attacker may cause an HTTP/2 endpoint to read arbitrary amounts of header data by sending an excessive number of CONTINUATION frames.
Maintaining HPACK state requires parsing and processing all HEADERS and CONTINUATION frames on a connection. When a request's headers exceed MaxHeaderBytes, no memory is allocated to store the excess headers, but they are still parsed.
This permits an attacker to cause an HTTP/2 endpoint to read arbitrary amounts of header data, all associated with a request which is going to be rejected. These headers can include Huffman-encoded data which is significantly more expensive for the receiver to decode than for an attacker to send.
The fix sets a limit on the amount of excess header frames we will process before closing a connection.

| Affected range | <1.20.0 | | Fixed version | 1.20.0 | | EPSS Score | 0.185% | | EPSS Percentile | 40th percentile |
Description
Before Go 1.20, the RSA based TLS key exchanges used the math/big library, which is not constant time. RSA blinding was applied to prevent timing attacks, but analysis shows this may not have been fully effective. In particular it appears as if the removal of PKCS#1 padding may leak timing information, which in turn could be used to recover session key bits.
In Go 1.20, the crypto/tls library switched to a fully constant time RSA implementation, which we do not believe exhibits any timing side channels.

| Affected range | <1.20.11 | | Fixed version | 1.20.11 | | EPSS Score | 0.097% | | EPSS Percentile | 27th percentile |
Description
The filepath package does not recognize paths with a ??\ prefix as special.
On Windows, a path beginning with ??\ is a Root Local Device path equivalent to a path beginning with \?. Paths with a ??\ prefix may be used to access arbitrary locations on the system. For example, the path ??\c:\x is equivalent to the more common path c:\x.
Before fix, Clean could convert a rooted path such as \a..??\b into the root local device path ??\b. Clean will now convert this to .??\b.
Similarly, Join(, ??, b) could convert a seemingly innocent sequence of path elements into the root local device path ??\b. Join will now convert this to .??\b.
In addition, with fix, IsAbs now correctly reports paths beginning with ??\ as absolute, and VolumeName correctly reports the ??\ prefix as a volume name.
UPDATE: Go 1.20.11 and Go 1.21.4 inadvertently changed the definition of the volume name in Windows paths starting with ?, resulting in filepath.Clean(?\c:) returning ?\c: rather than ?\c:\ (among other effects). The previous behavior has been restored.

| Affected range | <1.20.10 | | Fixed version | 1.20.10 | | EPSS Score | 94.419% | | EPSS Percentile | 100th percentile |
Description
A malicious HTTP/2 client which rapidly creates requests and immediately resets them can cause excessive server resource consumption. While the total number of requests is bounded by the http2.Server.MaxConcurrentStreams setting, resetting an in-progress request allows the attacker to create a new request while the existing one is still executing.
With the fix applied, HTTP/2 servers now bound the number of simultaneously executing handler goroutines to the stream concurrency limit (MaxConcurrentStreams). New requests arriving when at the limit (which can only happen after the client has reset an existing, in-flight request) will be queued until a handler exits. If the request queue grows too large, the server will terminate the connection.
This issue is also fixed in golang.org/x/net/http2 for users manually configuring HTTP/2.
The default stream concurrency limit is 250 streams (requests) per HTTP/2 connection. This value may be adjusted using the golang.org/x/net/http2 package; see the Server.MaxConcurrentStreams setting and the ConfigureServer function.

| Affected range | <1.20.10 | | Fixed version | 1.20.10 | | EPSS Score | 0.163% | | EPSS Percentile | 38th percentile |
Description
A malicious HTTP/2 client which rapidly creates requests and immediately resets them can cause excessive server resource consumption. While the total number of requests is bounded by the http2.Server.MaxConcurrentStreams setting, resetting an in-progress request allows the attacker to create a new request while the existing one is still executing.
With the fix applied, HTTP/2 servers now bound the number of simultaneously executing handler goroutines to the stream concurrency limit (MaxConcurrentStreams). New requests arriving when at the limit (which can only happen after the client has reset an existing, in-flight request) will be queued until a handler exits. If the request queue grows too large, the server will terminate the connection.
This issue is also fixed in golang.org/x/net/http2 for users manually configuring HTTP/2.
The default stream concurrency limit is 250 streams (requests) per HTTP/2 connection. This value may be adjusted using the golang.org/x/net/http2 package; see the Server.MaxConcurrentStreams setting and the ConfigureServer function.

| Affected range | <1.19.8 | | Fixed version | 1.19.8 | | EPSS Score | 0.013% | | EPSS Percentile | 2nd percentile |
Description
Calling any of the Parse functions on Go source code which contains //line directives with very large line numbers can cause an infinite loop due to integer overflow.

| Affected range | <1.19.8 | | Fixed version | 1.19.8 | | EPSS Score | 0.059% | | EPSS Percentile | 19th percentile |
Description
Multipart form parsing can consume large amounts of CPU and memory when processing form inputs containing very large numbers of parts.
This stems from several causes:
- mime/multipart.Reader.ReadForm limits the total memory a parsed multipart form can consume. ReadForm can undercount the amount of memory consumed, leading it to accept larger inputs than intended.
- Limiting total memory does not account for increased pressure on the garbage collector from large numbers of small allocations in forms with many parts.
- ReadForm can allocate a large number of short-lived buffers, further increasing pressure on the garbage collector.
The combination of these factors can permit an attacker to cause an program that parses multipart forms to consume large amounts of CPU and memory, potentially resulting in a denial of service. This affects programs that use mime/multipart.Reader.ReadForm, as well as form parsing in the net/http package with the Request methods FormFile, FormValue, ParseMultipartForm, and PostFormValue.
With fix, ReadForm now does a better job of estimating the memory consumption of parsed forms, and performs many fewer short-lived allocations.
In addition, the fixed mime/multipart.Reader imposes the following limits on the size of parsed forms:
- Forms parsed with ReadForm may contain no more than 1000 parts. This limit may be adjusted with the environment variable GODEBUG=multipartmaxparts=.
- Form parts parsed with NextPart and NextRawPart may contain no more than 10,000 header fields. In addition, forms parsed with ReadForm may contain no more than 10,000 header fields across all parts. This limit may be adjusted with the environment variable GODEBUG=multipartmaxheaders=.

| Affected range | <1.19.8 | | Fixed version | 1.19.8 | | EPSS Score | 0.040% | | EPSS Percentile | 12th percentile |
Description
HTTP and MIME header parsing can allocate large amounts of memory, even when parsing small inputs, potentially leading to a denial of service.
Certain unusual patterns of input data can cause the common function used to parse HTTP and MIME headers to allocate substantially more memory than required to hold the parsed headers. An attacker can exploit this behavior to cause an HTTP server to allocate large amounts of memory from a small request, potentially leading to memory exhaustion and a denial of service.
With fix, header parsing now correctly allocates only the memory required to hold parsed headers.

| Affected range | <1.19.6 | | Fixed version | 1.19.6 | | EPSS Score | 0.046% | | EPSS Percentile | 14th percentile |
Description
A denial of service is possible from excessive resource consumption in net/http and mime/multipart.
Multipart form parsing with mime/multipart.Reader.ReadForm can consume largely unlimited amounts of memory and disk files. This also affects form parsing in the net/http package with the Request methods FormFile, FormValue, ParseMultipartForm, and PostFormValue.
ReadForm takes a maxMemory parameter, and is documented as storing "up to maxMemory bytes +10MB (reserved for non-file parts) in memory". File parts which cannot be stored in memory are stored on disk in temporary files. The unconfigurable 10MB reserved for non-file parts is excessively large and can potentially open a denial of service vector on its own. However, ReadForm did not properly account for all memory consumed by a parsed form, such as map entry overhead, part names, and MIME headers, permitting a maliciously crafted form to consume well over 10MB. In addition, ReadForm contained no limit on the number of disk files created, permitting a relatively small request body to create a large number of disk temporary files.
With fix, ReadForm now properly accounts for various forms of memory overhead, and should now stay within its documented limit of 10MB + maxMemory bytes of memory consumption. Users should still be aware that this limit is high and may still be hazardous.
In addition, ReadForm now creates at most one on-disk temporary file, combining multiple form parts into a single temporary file. The mime/multipart.File interface type's documentation states, "If stored on disk, the File's underlying concrete type will be an *os.File.". This is no longer the case when a form contains more than one file part, due to this coalescing of parts into a single file. The previous behavior of using distinct files for each form part may be reenabled with the environment variable GODEBUG=multipartfiles=distinct.
Users should be aware that multipart.ReadForm and the http.Request methods that call it do not limit the amount of disk consumed by temporary files. Callers can limit the size of form data with http.MaxBytesReader.

| Affected range | <1.19.6 | | Fixed version | 1.19.6 | | EPSS Score | 0.016% | | EPSS Percentile | 3rd percentile |
Description
Large handshake records may cause panics in crypto/tls.
Both clients and servers may send large TLS handshake records which cause servers and clients, respectively, to panic when attempting to construct responses.
This affects all TLS 1.3 clients, TLS 1.2 clients which explicitly enable session resumption (by setting Config.ClientSessionCache to a non-nil value), and TLS 1.3 servers which request client certificates (by setting Config.ClientAuth >= RequestClientCert).

| Affected range | <1.19.6 | | Fixed version | 1.19.6 | | EPSS Score | 0.235% | | EPSS Percentile | 46th percentile |
Description
A maliciously crafted HTTP/2 stream could cause excessive CPU consumption in the HPACK decoder, sufficient to cause a denial of service from a small number of small requests.

| Affected range | <1.19.6 | | Fixed version | 1.19.6 | | EPSS Score | 0.169% | | EPSS Percentile | 38th percentile |
Description
A path traversal vulnerability exists in filepath.Clean on Windows.
On Windows, the filepath.Clean function could transform an invalid path such as "a/../c:/b" into the valid path "c:\b". This transformation of a relative (if invalid) path into an absolute path could enable a directory traversal attack.
After fix, the filepath.Clean function transforms this path into the relative (but still invalid) path ".\c:\b".

| Affected range | <1.18.9 | | Fixed version | 1.18.9 | | EPSS Score | 0.057% | | EPSS Percentile | 18th percentile |
Description
On Windows, restricted files can be accessed via os.DirFS and http.Dir.
The os.DirFS function and http.Dir type provide access to a tree of files rooted at a given directory. These functions permit access to Windows device files under that root. For example, os.DirFS("C:/tmp").Open("COM1") opens the COM1 device. Both os.DirFS and http.Dir only provide read-only filesystem access.
In addition, on Windows, an os.DirFS for the directory (the root of the current drive) can permit a maliciously crafted path to escape from the drive and access any path on the system.
With fix applied, the behavior of os.DirFS("") has changed. Previously, an empty root was treated equivalently to "/", so os.DirFS("").Open("tmp") would open the path "/tmp". This now returns an error.

| Affected range | <1.18.8 | | Fixed version | 1.18.8 | | EPSS Score | 0.022% | | EPSS Percentile | 5th percentile |
Description
Due to unsanitized NUL values, attackers may be able to maliciously set environment variables on Windows.
In syscall.StartProcess and os/exec.Cmd, invalid environment variable values containing NUL values are not properly checked for. A malicious environment variable value can exploit this behavior to set a value for a different environment variable. For example, the environment variable string "A=B\x00C=D" sets the variables "A=B" and "C=D".

| Affected range | <1.18.7 | | Fixed version | 1.18.7 | | EPSS Score | 0.016% | | EPSS Percentile | 3rd percentile |
Description
Programs which compile regular expressions from untrusted sources may be vulnerable to memory exhaustion or denial of service.
The parsed regexp representation is linear in the size of the input, but in some cases the constant factor can be as high as 40,000, making relatively small regexps consume much larger amounts of memory.
After fix, each regexp being parsed is limited to a 256 MB memory footprint. Regular expressions whose representation would use more space than that are rejected. Normal use of regular expressions is unaffected.

| Affected range | <1.17.13 | | Fixed version | 1.17.13 | | EPSS Score | 0.102% | | EPSS Percentile | 29th percentile |
Description
Decoding big.Float and big.Rat types can panic if the encoded message is too short, potentially allowing a denial of service.

| Affected range | <1.17.12 | | Fixed version | 1.17.12 | | EPSS Score | 0.160% | | EPSS Percentile | 37th percentile |
Description
Calling Decoder.Decode on a message which contains deeply nested structures can cause a panic due to stack exhaustion.

| Affected range | <1.17.11 | | Fixed version | 1.17.11 | | EPSS Score | 0.023% | | EPSS Percentile | 5th percentile |
Description
On Windows, rand.Read will hang indefinitely if passed a buffer larger than 1 << 32 - 1 bytes.

| Affected range | <1.17.12 | | Fixed version | 1.17.12 | | EPSS Score | 0.087% | | EPSS Percentile | 25th percentile |
Description
Unmarshaling an XML document into a Go struct which has a nested field that uses the 'any' field tag can panic due to stack exhaustion.

| Affected range | <1.17.12 | | Fixed version | 1.17.12 | | EPSS Score | 0.087% | | EPSS Percentile | 25th percentile |
Description
Calling Glob on a path which contains a large number of path separators can cause a panic due to stack exhaustion.

| Affected range | <1.17.12 | | Fixed version | 1.17.12 | | EPSS Score | 0.042% | | EPSS Percentile | 13th percentile |
Description
Calling Reader.Read on an archive containing a large number of concatenated 0-length compressed files can cause a panic due to stack exhaustion.

| Affected range | <1.17.12 | | Fixed version | 1.17.12 | | EPSS Score | 0.035% | | EPSS Percentile | 10th percentile |
Description
Calling Glob on a path which contains a large number of path separators can cause a panic due to stack exhaustion.

| Affected range | <1.17.11 | | Fixed version | 1.17.11 | | EPSS Score | 0.165% | | EPSS Percentile | 38th percentile |
Description
On Windows, the filepath.Clean function can convert certain invalid paths to valid, absolute paths, potentially allowing a directory traversal attack.
For example, Clean(".\c:") returns "c:".

| Affected range | <1.18.7 | | Fixed version | 1.18.7 | | EPSS Score | 0.031% | | EPSS Percentile | 8th percentile |
Description
Requests forwarded by ReverseProxy include the raw query parameters from the inbound request, including unparsable parameters rejected by net/http. This could permit query parameter smuggling when a Go proxy forwards a parameter with an unparsable value.
After fix, ReverseProxy sanitizes the query parameters in the forwarded query when the outbound request's Form field is set after the ReverseProxy. Director function returns, indicating that the proxy has parsed the query parameters. Proxies which do not parse query parameters continue to forward the original query parameters unchanged.

| Affected range | <1.18.7 | | Fixed version | 1.18.7 | | EPSS Score | 0.016% | | EPSS Percentile | 3rd percentile |
Description
Reader.Read does not set a limit on the maximum size of file headers. A maliciously crafted archive could cause Read to allocate unbounded amounts of memory, potentially causing resource exhaustion or panics. After fix, Reader.Read limits the maximum size of header blocks to 1 MiB.

| Affected range | <1.17.9 | | Fixed version | 1.17.9 | | EPSS Score | 0.129% | | EPSS Percentile | 33rd percentile |
Description
A crafted scalar input longer than 32 bytes can cause P256().ScalarMult or P256().ScalarBaseMult to panic. Indirect uses through crypto/ecdsa and crypto/tls are unaffected. amd64, arm64, ppc64le, and s390x are unaffected.

| Affected range | <1.17.12 | | Fixed version | 1.17.12 | | EPSS Score | 0.013% | | EPSS Percentile | 2nd percentile |
Description
Calling Decoder.Skip when parsing a deeply nested XML document can cause a panic due to stack exhaustion.

| Affected range | <1.18.6 | | Fixed version | 1.18.6 | | EPSS Score | 0.096% | | EPSS Percentile | 27th percentile |
Description
HTTP/2 server connections can hang forever waiting for a clean shutdown that was preempted by a fatal error. This condition can be exploited by a malicious client to cause a denial of service.

| Affected range | <1.16.15 | | Fixed version | 1.16.15 | | EPSS Score | 0.020% | | EPSS Percentile | 4th percentile |
Description
On 64-bit platforms, an extremely deeply nested expression can cause regexp.Compile to cause goroutine stack exhaustion, forcing the program to exit. Note this applies to very large expressions, on the order of 2MB.

| Affected range | <1.17.9 | | Fixed version | 1.17.9 | | EPSS Score | 0.132% | | EPSS Percentile | 34th percentile |
Description
encoding/pem in Go before 1.17.9 and 1.18.x before 1.18.1 has a Decode stack overflow via a large amount of PEM data.

| Affected range | <1.16.14 | | Fixed version | 1.16.14 | | EPSS Score | 0.017% | | EPSS Percentile | 3rd percentile |
Description
Rat.SetString had an overflow issue that can lead to uncontrolled memory consumption.

| Affected range | <1.16.12 | | Fixed version | 1.16.12 | | EPSS Score | 0.114% | | EPSS Percentile | 31st percentile |
Description
An attacker can cause unbounded memory growth in servers accepting HTTP/2 requests.

| Affected range | <1.16.10 | | Fixed version | 1.16.10 | | EPSS Score | 0.062% | | EPSS Percentile | 19th percentile |
Description
Previously, opening a zip with (*Reader).Open could result in a panic if the zip contained a file whose name was exclusively made up of slash characters or ".." path elements.
Open could also panic if passed the empty string directly as an argument.
Now, any files in the zip whose name could not be made valid for fs.FS.Open will be skipped, and no longer added to the fs.FS file list, although they are still accessible through (*Reader).File.
Note that it was already the case that a file could be accessible from (*Reader).Open with a name different from the one in (*Reader).File, as the former is the cleaned name, while the latter is the original one.
Finally, the actual panic site was made robust as a defense-in-depth measure.

| Affected range | <1.16.10 | | Fixed version | 1.16.10 | | EPSS Score | 0.431% | | EPSS Percentile | 62nd percentile |
Description
Calling File.ImportedSymbols on a loaded file which contains an invalid dynamic symbol table command can cause a panic, in particular if the encoded number of undefined symbols is larger than the number of symbols in the symbol table.

| Affected range | <1.16.8 | | Fixed version | 1.16.8 | | EPSS Score | 0.039% | | EPSS Percentile | 11th percentile |
Description
The NewReader and OpenReader functions in archive/zip can cause a panic or an unrecoverable fatal error when reading an archive that claims to contain a large number of files, regardless of its actual size. This is caused by an incomplete fix for CVE-2021-33196.

| Affected range | >=1.16.0-0 <1.16.5
| | Fixed version | 1.16.5 | | EPSS Score | 0.028% | | EPSS Percentile | 7th percentile |
Description
Rat.SetString and Rat.UnmarshalText may cause a panic or an unrecoverable fatal error if passed inputs with very large exponents.

| Affected range | >=1.16.0-0 <1.16.5
| | Fixed version | 1.16.5 | | EPSS Score | 0.024% | | EPSS Percentile | 5th percentile |
Description
NewReader and OpenReader can cause a panic or an unrecoverable fatal error when reading an archive that claims to contain a large number of files, regardless of its actual size.

| Affected range | >=1.16.0-0 <1.16.1
| | Fixed version | 1.16.1 | | EPSS Score | 0.025% | | EPSS Percentile | 6th percentile |
Description
The Decode, DecodeElement, and Skip methods of an xml.Decoder provided by xml.NewTokenDecoder may enter an infinite loop when operating on a custom xml.TokenReader which returns an EOF in the middle of an open XML element.

| Affected range | <1.19.9 | | Fixed version | 1.19.9 | | EPSS Score | 0.049% | | EPSS Percentile | 15th percentile |
Description
Templates containing actions in unquoted HTML attributes (e.g. "attr={{.}}") executed with empty input can result in output with unexpected results when parsed due to HTML normalization rules. This may allow injection of arbitrary attributes into tags.

| Affected range | <1.19.9 | | Fixed version | 1.19.9 | | EPSS Score | 0.067% | | EPSS Percentile | 21st percentile |
Description
Angle brackets (<>) are not considered dangerous characters when inserted into CSS contexts. Templates containing multiple actions separated by a '/' character can result in unexpectedly closing the CSS context and allowing for injection of unexpected HTML, if executed with untrusted input.

| Affected range | >=1.16.0-0 <1.16.5
| | Fixed version | 1.16.5 | | EPSS Score | 0.032% | | EPSS Percentile | 9th percentile |
Description
The LookupCNAME, LookupSRV, LookupMX, LookupNS, and LookupAddr functions and their respective methods on the Resolver type may return arbitrary values retrieved from DNS which do not follow the established RFC 1035 rules for domain names. If these names are used without further sanitization, for instance unsafely included in HTML, they may allow for injection of unexpected content. Note that LookupTXT may still return arbitrary values that could require sanitization before further use.

| Affected range | <1.23.10 | | Fixed version | 1.23.10 | | EPSS Score | 0.010% | | EPSS Percentile | 1st percentile |
Description
Proxy-Authorization and Proxy-Authenticate headers persisted on cross-origin redirects potentially leaking sensitive information.

| Affected range | <1.24.11 | | Fixed version | 1.24.11 | | EPSS Score | 0.021% | | EPSS Percentile | 5th percentile |
Description
An excluded subdomain constraint in a certificate chain does not restrict the usage of wildcard SANs in the leaf certificate. For example a constraint that excludes the subdomain test.example.com does not prevent a leaf certificate from claiming the SAN *.example.com.

| Affected range | <1.23.12 | | Fixed version | 1.23.12 | | EPSS Score | 0.020% | | EPSS Percentile | 5th percentile |
Description
If the PATH environment variable contains paths which are executables (rather than just directories), passing certain strings to LookPath ("", ".", and ".."), can result in the binaries listed in the PATH being unexpectedly returned.

| Affected range | <1.21.8 | | Fixed version | 1.21.8 | | EPSS Score | 0.362% | | EPSS Percentile | 58th percentile |
Description
When parsing a multipart form (either explicitly with Request.ParseMultipartForm or implicitly with Request.FormValue, Request.PostFormValue, or Request.FormFile), limits on the total size of the parsed form were not applied to the memory consumed while reading a single form line. This permits a maliciously crafted input containing very long lines to cause allocation of arbitrarily large amounts of memory, potentially leading to memory exhaustion.
With fix, the ParseMultipartForm function now correctly limits the maximum size of form lines.

| Affected range | <1.19.11 | | Fixed version | 1.19.11 | | EPSS Score | 0.236% | | EPSS Percentile | 46th percentile |
Description
The HTTP/1 client does not fully validate the contents of the Host header. A maliciously crafted Host header can inject additional headers or entire requests.
With fix, the HTTP/1 client now refuses to send requests containing an invalid Request.Host or Request.URL.Host value.

| Affected range | <1.17.12 | | Fixed version | 1.17.12 | | EPSS Score | 0.057% | | EPSS Percentile | 18th percentile |
Description
Client IP adresses may be unintentionally exposed via X-Forwarded-For headers.
When httputil.ReverseProxy.ServeHTTP is called with a Request.Header map containing a nil value for the X-Forwarded-For header, ReverseProxy sets the client IP as the value of the X-Forwarded-For header, contrary to its documentation.
In the more usual case where a Director function sets the X-Forwarded-For header value to nil, ReverseProxy leaves the header unmodified as expected.

| Affected range | <1.17.12 | | Fixed version | 1.17.12 | | EPSS Score | 0.055% | | EPSS Percentile | 17th percentile |
Description
The HTTP/1 client accepted some invalid Transfer-Encoding headers as indicating a "chunked" encoding. This could potentially allow for request smuggling, but only if combined with an intermediate server that also improperly failed to reject the header as invalid.

| Affected range | >=1.16.0-0 <1.16.6
| | Fixed version | 1.16.6 | | EPSS Score | 1.475% | | EPSS Percentile | 80th percentile |
Description
crypto/tls clients can panic when provided a certificate of the wrong type for the negotiated parameters. net/http clients performing HTTPS requests are also affected.

| Affected range | <1.22.11 | | Fixed version | 1.22.11 | | EPSS Score | 0.048% | | EPSS Percentile | 15th percentile |
Description
A certificate with a URI which has a IPv6 address with a zone ID may incorrectly satisfy a URI name constraint that applies to the certificate chain.
Certificates containing URIs are not permitted in the web PKI, so this only affects users of private PKIs which make use of URIs.

| Affected range | <1.22.11 | | Fixed version | 1.22.11 | | EPSS Score | 0.078% | | EPSS Percentile | 24th percentile |
Description
The HTTP client drops sensitive headers after following a cross-domain redirect. For example, a request to a.com/ containing an Authorization header which is redirected to b.com/ will not send that header to b.com.
In the event that the client received a subsequent same-domain redirect, however, the sensitive headers would be restored. For example, a chain of redirects from a.com/, to b.com/1, and finally to b.com/2 would incorrectly send the Authorization header to b.com/2.

| Affected range | <1.20.8 | | Fixed version | 1.20.8 | | EPSS Score | 0.085% | | EPSS Percentile | 25th percentile |
Description
The html/template package does not apply the proper rules for handling occurrences of "<script", "<!--", and "</script" within JS literals in
</blockquote>
</details>
<a href="https://scout.docker.com/v/CVE-2023-39318?s=golang&n=stdlib&t=golang&vr=%3C1.20.8"><img alt="medium : CVE--2023--39318" src="https://img.shields.io/badge/CVE--2023--39318-lightgrey?label=medium%20&labelColor=fbb552"/></a>
| Affected range | <1.20.8 | | Fixed version | 1.20.8 | | EPSS Score | 0.085% | | EPSS Percentile | 25th percentile |
Description
The html/template package does not properly handle HTML-like "" comment tokens, nor hashbang "#!" comment tokens, in
</blockquote>
</details>
<a href="https://scout.docker.com/v/CVE-2024-24783?s=golang&n=stdlib&t=golang&vr=%3C1.21.8"><img alt="medium : CVE--2024--24783" src="https://img.shields.io/badge/CVE--2024--24783-lightgrey?label=medium%20&labelColor=fbb552"/></a>
| Affected range | <1.21.8 | | Fixed version | 1.21.8 | | EPSS Score | 0.445% | | EPSS Percentile | 63rd percentile |
Description
Verifying a certificate chain which contains a certificate with an unknown public key algorithm will cause Certificate.Verify to panic.
This affects all crypto/tls clients, and servers that set Config.ClientAuth to VerifyClientCertIfGiven or RequireAndVerifyClientCert. The default behavior is for TLS servers to not verify client certificates.

| Affected range | >=1.16.0-0 <1.16.7
| | Fixed version | 1.16.7 | | EPSS Score | 0.198% | | EPSS Percentile | 42nd percentile |
Description
ReverseProxy can panic after encountering a problem copying a proxied response body.

| Affected range | >=1.16.0-0 <1.16.4
| | Fixed version | 1.16.4 | | EPSS Score | 0.013% | | EPSS Percentile | 2nd percentile |
Description
A malicious HTTP server or client can cause the net/http client or server to panic.
ReadRequest and ReadResponse can hit an unrecoverable panic when reading a very large header (over 7MB on 64-bit architectures, or over 4MB on 32-bit ones). Transport and Client are vulnerable and the program can be made to crash by a malicious server. Server is not vulnerable by default, but can be if the default max header of 1MB is overridden by setting Server.MaxHeaderBytes to a higher value, in which case the program can be made to crash by a malicious client.
This also affects golang.org/x/net/http2/h2c and HeaderValuesContainsToken in golang.org/x/net/http/httpguts.

| Affected range | <1.23.10 | | Fixed version | 1.23.10 | | EPSS Score | 0.008% | | EPSS Percentile | 1st percentile |
Description
os.OpenFile(path, os.O_CREATE|O_EXCL) behaved differently on Unix and Windows systems when the target path was a dangling symlink. On Unix systems, OpenFile with O_CREATE and O_EXCL flags never follows symlinks. On Windows, when the target path was a symlink to a nonexistent location, OpenFile would create a file in that location. OpenFile now always returns an error when the O_CREATE and O_EXCL flags are both set and the target path is a symlink.

| Affected range | <1.21.11 | | Fixed version | 1.21.11 | | EPSS Score | 0.006% | | EPSS Percentile | 0th percentile |
Description
The archive/zip package's handling of certain types of invalid zip files differs from the behavior of most zip implementations. This misalignment could be exploited to create an zip file with contents that vary depending on the implementation reading the file. The archive/zip package now rejects files containing these errors.

| Affected range | <1.17.12 | | Fixed version | 1.17.12 | | EPSS Score | 0.005% | | EPSS Percentile | 0th percentile |
Description
Calling any of the Parse functions on Go source code which contains deeply nested types or declarations can cause a panic due to stack exhaustion.

| Affected range | >=1.16.0-0 <1.16.1
| | Fixed version | 1.16.1 | | EPSS Score | 0.132% | | EPSS Percentile | 34th percentile |
Description
Using Reader.Open on an archive containing a file with a path prefixed by "../" will cause a panic due to a stack overflow. If parsing user supplied archives, this may be used as a denial of service vector.

| Affected range | <1.21.8 | | Fixed version | 1.21.8 | | EPSS Score | 0.273% | | EPSS Percentile | 50th percentile |
Description
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.

| Affected range | <1.24.8 | | Fixed version | 1.24.8 | | EPSS Score | 0.025% | | EPSS Percentile | 6th percentile |
Description
The Reader.ReadResponse function constructs a response string through repeated string concatenation of lines. When the number of lines in a response is large, this can cause excessive CPU consumption.

| Affected range | <1.24.8 | | Fixed version | 1.24.8 | | EPSS Score | 0.019% | | EPSS Percentile | 4th percentile |
Description
When Conn.Handshake fails during ALPN negotiation the error contains attacker controlled information (the ALPN protocols sent by the client) which is not escaped.

| Affected range | <1.24.8 | | Fixed version | 1.24.8 | | EPSS Score | 0.029% | | EPSS Percentile | 7th percentile |
Description
Despite HTTP headers having a default limit of 1MB, the number of cookies that can be parsed does not have a limit. By sending a lot of very small cookies such as "a=;", an attacker can make an HTTP server allocate a large amount of structs, causing large memory consumption.

| Affected range | <1.24.8 | | Fixed version | 1.24.8 | | EPSS Score | 0.033% | | EPSS Percentile | 9th percentile |
Description
Parsing a maliciously crafted DER payload could allocate large amounts of memory, causing memory exhaustion.

| Affected range | <1.24.8 | | Fixed version | 1.24.8 | | EPSS Score | 0.025% | | EPSS Percentile | 6th percentile |
Description
The Parse function permits values other than IPv6 addresses to be included in square brackets within the host component of a URL. RFC 3986 permits IPv6 addresses to be included within the host component, enclosed within square brackets. For example: "http://[::1]/". IPv4 addresses and hostnames must not appear within square brackets. Parse did not enforce this requirement.

| Affected range | <1.20.11 | | Fixed version | 1.20.11 | | EPSS Score | 0.040% | | EPSS Percentile | 12th percentile |
Description
On Windows, The IsLocal function does not correctly detect reserved device names in some cases.
Reserved names followed by spaces, such as "COM1 ", and reserved names "COM" and "LPT" followed by superscript 1, 2, or 3, are incorrectly reported as local.
With fix, IsLocal now correctly reports these names as non-local.

| Affected range | <1.20.12 | | Fixed version | 1.20.12 | | EPSS Score | 0.048% | | EPSS Percentile | 15th percentile |
Description
A malicious HTTP sender can use chunk extensions to cause a receiver reading from a request or response body to read many more bytes from the network than are in the body.
A malicious HTTP client can further exploit this to cause a server to automatically read a large amount of data (up to about 1GiB) when a handler fails to read the entire body of a request.
Chunk extensions are a little-used HTTP feature which permit including additional metadata in a request or response body sent using the chunked encoding. The net/http chunked encoding reader discards this metadata. A sender can exploit this by inserting a large metadata segment with each byte transferred. The chunk reader now produces an error if the ratio of real body to encoded bytes grows too small.

| Affected range | <1.19.12 | | Fixed version | 1.19.12 | | EPSS Score | 0.112% | | EPSS Percentile | 30th percentile |
Description
Extremely large RSA keys in certificate chains can cause a client/server to expend significant CPU time verifying signatures.
With fix, the size of RSA keys transmitted during handshakes is restricted to <= 8192 bits.
Based on a survey of publicly trusted RSA keys, there are currently only three certificates in circulation with keys larger than this, and all three appear to be test certificates that are not actively deployed. It is possible there are larger keys in use in private PKIs, but we target the web PKI, so causing breakage here in the interests of increasing the default safety of users of crypto/tls seems reasonable.

| Affected range | <1.19.7 | | Fixed version | 1.19.7 | | EPSS Score | 0.024% | | EPSS Percentile | 6th percentile |
Description
The ScalarMult and ScalarBaseMult methods of the P256 Curve may return an incorrect result if called with some specific unreduced scalars (a scalar larger than the order of the curve).
This does not impact usages of crypto/ecdsa or crypto/ecdh.

| Affected range | <1.18.9 | | Fixed version | 1.18.9 | | EPSS Score | 0.541% | | EPSS Percentile | 67th percentile |
Description
An attacker can cause excessive memory growth in a Go server accepting HTTP/2 requests.
HTTP/2 server connections contain a cache of HTTP header keys sent by the client. While the total number of entries in this cache is capped, an attacker sending very large keys can cause the server to allocate approximately 64 MiB per open connection.

| Affected range | <1.17.10 | | Fixed version | 1.17.10 | | EPSS Score | 0.173% | | EPSS Percentile | 39th percentile |
Description
When called with a non-zero flags parameter, the Faccessat function can incorrectly report that a file is accessible.

| Affected range | >=1.16.0-0 <1.16.5
| | Fixed version | 1.16.5 | | EPSS Score | 0.033% | | EPSS Percentile | 9th percentile |
Description
ReverseProxy can be made to forward certain hop-by-hop headers, including Connection. If the target of the ReverseProxy is itself a reverse proxy, this lets an attacker drop arbitrary headers, including those set by the ReverseProxy.Director.

| Affected range | <1.16.12 | | Fixed version | 1.16.12 | | EPSS Score | 0.441% | | EPSS Percentile | 62nd percentile |
Description
When a Go program running on a Unix system is out of file descriptors and calls syscall.ForkExec (including indirectly by using the os/exec package), syscall.ForkExec can close file descriptor 0 as it fails. If this happens (or can be provoked) repeatedly, it can result in misdirected I/O such as writing network traffic intended for one connection to a different connection, or content intended for one file to a different one.
For users who cannot immediately update to the new release, the bug can be mitigated by raising the per-process file descriptor limit.

| Affected range | <1.24.8 | | Fixed version | 1.24.8 | | EPSS Score | 0.014% | | EPSS Percentile | 2nd percentile |
Description
tar.Reader does not set a maximum size on the number of sparse region data blocks in GNU tar pax 1.0 sparse files. A maliciously-crafted archive containing a large number of sparse regions can cause a Reader to read an unbounded amount of data from the archive into memory. When reading from a compressed source, a small compressed input can result in large allocations.

| Affected range | <1.22.7 | | Fixed version | 1.22.7 | | EPSS Score | 0.073% | | EPSS Percentile | 22nd percentile |
Description
Calling any of the Parse functions on Go source code which contains deeply nested literals can cause a panic due to stack exhaustion.

| Affected range | <1.21.8 | | Fixed version | 1.21.8 | | EPSS Score | 0.454% | | EPSS Percentile | 63rd percentile |
Description
When following an HTTP redirect to a domain which is not a subdomain match or exact match of the initial domain, an http.Client does not forward sensitive headers such as "Authorization" or "Cookie". For example, a redirect from foo.com to www.foo.com will forward the Authorization header, but a redirect to bar.com will not.
A maliciously crafted HTTP redirect could cause sensitive headers to be unexpectedly forwarded.

| Affected range | <1.22.12 | | Fixed version | 1.22.12 | | EPSS Score | 0.017% | | EPSS Percentile | 3rd percentile |
Description
Due to the usage of a variable time instruction in the assembly implementation of an internal function, a small number of bits of secret scalars are leaked on the ppc64le architecture. Due to the way this function is used, we do not believe this leakage is enough to allow recovery of the private key when P-256 is used in any well known protocols.

| Affected range | <1.17.11 | | Fixed version | 1.17.11 | | EPSS Score | 0.068% | | EPSS Percentile | 21st percentile |
Description
An attacker can correlate a resumed TLS session with a previous connection.
Session tickets generated by crypto/tls do not contain a randomly generated ticket_age_add, which allows an attacker that can observe TLS handshakes to correlate successive connections by comparing ticket ages during session resumption.
|
github.com/nats-io/jwt 0.3.2 (golang)
pkg:golang/github.com/nats-io/jwt@0.3.2
Use of Hard-coded Credentials
| Affected range | <1.1.0 | | Fixed version | 1.1.0 | | CVSS Score | 9.8 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H | | EPSS Score | 0.465% | | EPSS Percentile | 64th percentile |
Description
Problem Description
NATS nats-server through 2020-10-07 has Incorrect Access Control because of how expired credentials are handled.
The NATS accounts system has expiration timestamps on credentials; the https://github.com/nats-io/jwt library had an API which encouraged misuse and an IsRevoked() method which misused its own API.
A new IsClaimRevoked() method has correct handling and the nats-server has been updated to use this. The old IsRevoked() method now always returns true and other client code will have to be updated to avoid calling it.
The CVE identifier should cover any application using the old JWT API, where the nats-server is one of those applications.
Affected versions
JWT library
- all versions prior to 1.1.0
- fixed after nats-io/jwt PR 103 landed (2020-10-06)
NATS Server
- Version 2 prior to 2.1.9
- 2.0.0 through and including 2.1.8 are vulnerable.
- fixed with nats-io/nats-server PRs 1632, 1635, 1645
Impact
Time-based credential expiry did not work.
Workaround
Have credentials which only expire after fixes can be deployed.
Solution
Upgrade the JWT dependency in any application using it.
Upgrade the NATS server if using NATS Accounts.
Incorrect Authorization
| Affected range | <=1.2.2 | | Fixed version | Not Fixed | | EPSS Score | 0.290% | | EPSS Percentile | 52nd percentile |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2021-3127.txt)
Problem Description
The NATS server provides for Subjects which are namespaced by Account; all Subjects are supposed to be private to an account, with an Export/Import system used to grant cross-account access to some Subjects. Some Exports are public, such that anyone can import the
relevant subjects, and some Exports are private, such that the Import requires a token JWT to prove permission.
The JWT library's validation of the bindings in the Import Token incorrectly warned on mismatches, instead of outright rejecting the token.
As a result, any account can take an Import token used by any other account and re-use it for themselves because the binding to the
importing account is not rejected, and use it to import any Subject from the Exporting account, not just the Subject referenced in the Import Token.
The NATS account-server system treats account JWTs as semi-public information, such that an attacker can easily enumerate all account JWTs and retrieve all Import Tokens from those account JWTs.
The CVE identifier should cover the JWT library repair and the nats-server containing the fixed JWT library, and any other application depending upon the fixed JWT library.
Affected versions
JWT library
- all versions prior to 2.0.1
- fixed after nats-io/jwt#149 landed (2021-03-14)
NATS Server
- Version 2 prior to 2.2.0
- 2.0.0 through and including 2.1.9 are vulnerable
- fixed with nats-io/nats-server@423b79440c (2021-03-14)
Impact
In deployments with untrusted accounts able to update the Account Server with imports, a malicious account can access any Subject from an account which provides Exported Subjects.
Abuse of this facility requires the malicious actor to upload their tampered Account JWT to the Account Server, providing the service operator with a data-store which can be scanned for signs of abuse.
Workaround
Deny access to clients to update their account JWT in the account server.
Solution
Upgrade the JWT dependency in any application using it.
Upgrade the NATS server if using NATS Accounts (with private Exports; Account owners can create those at any time though).
Audit all accounts JWTs to scan for exploit attempts; a Python script to audit the accounts can be found at https://gist.github.com/philpennock/09d49524ad98043ff11d8a40c2bb0d5a.
NULL Pointer Dereference
| Affected range | <1.1.0 | | Fixed version | 1.1.0 | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.682% | | EPSS Percentile | 71st percentile |
Description
Problem Description
The NATS account system has an Operator trusted by the servers, which signs Accounts, and each Account can then create and sign Users within their account. The Operator should be able to safely issue Accounts to other entities which it does not fully trust.
A malicious Account could create and sign a User JWT with a state not created by the normal tooling, such that decoding by the NATS JWT library (written in Go) would attempt a nil dereference, aborting execution.
The NATS Server is known to be impacted by this.
Affected versions
JWT library
- all versions prior to 1.1.0
NATS Server
Impact
JWT library
- Programs would nil dereference and panic, aborting execution by default.
NATS server
- Denial of Service caused by process termination
Workaround
If your NATS servers do not trust any accounts which are managed by untrusted entities, then malformed User credentials are unlikely to be encountered.
Solution
Upgrade the JWT dependency in any application using it.
Upgrade the NATS server if using NATS Accounts.
OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
| Affected range | <v1.2.3-0.20210314221642-a826c77dc9d2 | | Fixed version | v1.2.3-0.20210314221642-a826c77dc9d2 |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2021-3127.txt)
Problem Description
The NATS server provides for Subjects which are namespaced by Account; all Subjects are supposed to be private to an account, with an Export/Import system used to grant cross-account access to some Subjects. Some Exports are public, such that anyone can import the relevant subjects, and some Exports are private, such that the Import requires a token JWT to prove permission.
The JWT library's validation of the bindings in the Import Token incorrectly warned on mismatches, instead of outright rejecting the token.
As a result, any account can take an Import token used by any other account and re-use it for themselves because the binding to the importing account is not rejected, and use it to import any Subject from the Exporting account, not just the Subject referenced in the Import Token.
The NATS account-server system treats account JWTs as semi-public information, such that an attacker can easily enumerate all account JWTs and retrieve all Import Tokens from those account JWTs.
The CVE identifier should cover the JWT library repair and the nats-server containing the fixed JWT library, and any other application depending upon the fixed JWT library.
Affected versions
JWT library
- all versions prior to 2.0.1
- fixed after nats-io/jwt#149 landed (2021-03-14)
NATS Server
- 2.0.0 through and including 2.1.9 is vulnerable
- fixed with nats-io/nats-server@423b79440c (2021-03-14)
Impact
In deployments with untrusted accounts able to update the Account Server with imports, a malicious account can access any Subject from an account which provides Exported Subjects.
Abuse of this facility requires the malicious actor to upload their tampered Account JWT to the Account Server, providing the service operator with a data-store which can be scanned for signs of abuse.
Workaround
Deny access to clients to update their account JWT in the account server.
Solution
Upgrade the JWT dependency in any application using it.
Upgrade the NATS server if using NATS Accounts (with private Exports; Account owners can create those at any time though).
Audit all accounts JWTs to scan for exploit attempts; a Python script to audit the accounts can be found at https://gist.github.com/philpennock/09d49524ad98043ff11d8a40c2bb0d5a.
OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
| Affected range | <v1.1.0 | | Fixed version | v1.1.0 |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2020-26521.txt)
Problem Description
The NATS account system has an Operator trusted by the servers, which signs Accounts, and each Account can then create and sign Users within their account. The Operator should be able to safely issue Accounts to other entities which it does not fully trust.
A malicious Account could create and sign a User JWT with a state not created by the normal tooling, such that decoding by the NATS JWT library (written in Go) would attempt a nil dereference, aborting execution.
The NATS Server is known to be impacted by this.
Affected versions
JWT library
- all versions prior to 1.1.0
NATS Server
Impact
JWT library
- Programs would nil dereference and panic, aborting execution by default.
NATS server
- Denial of Service caused by process termination
Workaround
If your NATS servers do not trust any accounts which are managed by untrusted entities, then malformed User credentials are unlikely to be encountered.
Solution
Upgrade the JWT dependency in any application using it.
Upgrade the NATS server if using NATS Accounts.
OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
| Affected range | <v1.1.0 | | Fixed version | v1.1.0 |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2020-26892.txt )
Problem Description
NATS nats-server through 2020-10-07 has Incorrect Access Control because of how expired credentials are handled.
The NATS accounts system has expiration timestamps on credentials; the https://github.com/nats-io/jwt library had an API which encouraged misuse and an IsRevoked() method which misused its own API.
A new IsClaimRevoked() method has correct handling and the nats-server has been updated to use this. The old IsRevoked() method now always returns true and other client code will have to be updated to avoid calling it.
The CVE identifier should cover any application using the old JWT API, where the nats-server is one of those applications.
Affected versions
JWT library
- all versions prior to 1.1.0
- fixed after nats-io/jwt PR 103 landed (2020-10-06)
NATS Server
- 2.0.0 through and including 2.1.8 is vulnerable.
- fixed with nats-io/nats-server PRs 1632, 1635, 1645
Impact
Time-based credential expiry does not work.
Workaround
Have credentials which only expire after fixes can be deployed.
Solution
Upgrade the JWT dependency in any application using it.
Upgrade the NATS server if using NATS Accounts.
|
github.com/nats-io/nats-server/v2 2.2.2 (golang)
pkg:golang/github.com/nats-io/nats-server@2.2.2#v2
Improper Authorization
| Affected range | >=2.2.0 <2.10.27
| | Fixed version | 2.10.27 | | CVSS Score | 9.6 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H | | EPSS Score | 0.053% | | EPSS Percentile | 17th percentile |
Description
Advisory
The management of JetStream assets happens with messages in the $JS. subject namespace in the system account; this is partially exposed into regular accounts to allow account holders to manage their assets.
Some of the JS API requests were missing access controls, allowing any user with JS management permissions in any account to perform certain administrative actions on any JS asset in any other account. At least one of the unprotected APIs allows for data destruction. None of the affected APIs allow disclosing stream contents.
Affected versions
NATS Server:
- Version 2 from v2.2.0 onwards, prior to v2.11.1 or v2.10.27
Original Report
(Lightly edited to confirm some supposition and in the summary to use past tense)
Summary
nats-server did not include authorization checks on 4 separate admin-level JetStream APIs: account purge, server remove, account stream move, and account stream cancel-move.
In all cases, APIs are not properly restricted to system-account users. Instead, any authorized user can execute the APIs, including across account boundaries, as long as the current user merely has permission to publish on $JS.>.
Only the first seems to be of highest severity. All are included in this single report as they seem likely to have the same underlying root cause.
Reproduction of the ACCOUNT.PURGE case is below. The others are like it.
Details & Impact
Issue 1: $JS.API.ACCOUNT.PURGE.*
Any user may perform an account purge of any other account (including their own).
Risk: total destruction of Jetstream configuration and data.
Issue 2: $JS.API.SERVER.REMOVE
Any user may remove servers from Jetstream clusters.
Risk: Loss of data redundancy, reduction of service quality.
Issue 3: $JS.API.ACCOUNT.STREAM.MOVE.*.* and CANCEL_MOVE
Any user may cause streams to be moved between servers.
Risk: loss of control of data provenance, reduced service quality during move, enumeration of account and/or stream names.
Similarly for $JS.API.ACCOUNT.STREAM.CANCEL_MOVE.*.*
Mitigations
It appears that users without permission to publish on $JS.API.ACCOUNT.> or $JS.API.SERVER.> are unable to execute the above APIs.
Unfortunately, in many configurations, an 'admin' user for a single account will be given permissions for $JS.> (or simply >), which allows the improper access to the system APIs above.
Scope of impact
Issues 1 and 3 both cross boundaries between accounts, violating promised account isolation. All 3 allow system level access to non-system account users.
While I cannot speak to what authz configurations are actually found in the wild, per the discussion in Mitigations above, it seems likely that at least some configurations are vulnerable.
Additional notes
It appears that $JS.API.META.LEADER.STEPDOWN does properly restrict to system account users. As such, this may be a pattern for how to properly authorize these other APIs.
PoC
Environment
Tested with:
nats-server 2.10.26 (installed via homebrew)
nats cli 0.1.6 (installed via homebrew)
macOS 13.7.4
Reproduction steps
$ nats-server --version nats-server: v2.10.26
$ nats --version 0.1.6
$ cat nats-server.conf listen: '0.0.0.0:4233' jetstream: { store_dir: './tmp' } accounts: { '$SYS': { users: [{user: 'sys', password: 'sys'}] }, 'TEST': { jetstream: true, users: [{user: 'a', password: 'a'}] }, 'TEST2': { jetstream: true, users: [{user: 'b', password: 'b'}] } }
$ nats-server -c ./nats-server.conf ... [90608] 2025/03/02 11:43:18.494663 [INF] Using configuration file: ./nats-server.conf ... [90608] 2025/03/02 11:43:18.496395 [INF] Listening for client connections on 0.0.0.0:4233 ...
# Authentication is effectively enabled by the server: $ nats -s nats://localhost:4233 account info nats: error: setup failed: nats: Authorization Violation
$ nats -s nats://localhost:4233 account info --user sys --password wrong nats: error: setup failed: nats: Authorization Violation
$ nats -s nats://localhost:4233 account info --user a --password wrong nats: error: setup failed: nats: Authorization Violation
$ nats -s nats://localhost:4233 account info --user b --password wrong nats: error: setup failed: nats: Authorization Violation
# Valid credentials work, and users properly matched to accounts: $ nats -s nats://localhost:4233 account info --user sys --password sys Account Information User: sys Account: $SYS ...
$ nats -s nats://localhost:4233 account info --user a --password a Account Information User: a Account: TEST ...
$ nats -s nats://localhost:4233 account info --user b --password b Account Information User: b Account: TEST2 ...
# Add a stream and messages to account TEST (user 'a'): $ nats -s nats://localhost:4233 --user a --password a stream add stream1 --subjects s1 --storage file --defaults Stream stream1 was created ...
$ nats -s nats://localhost:4233 --user a --password a publish s1 --count 3 "msg {{Count}}" 11:50:05 Published 5 bytes to "s1" 11:50:05 Published 5 bytes to "s1" 11:50:05 Published 5 bytes to "s1"
# Messages are correctly persisted on account TEST, and not on TEST2: $ nats -s nats://localhost:4233 --user a --password a stream ls ╭───────────────────────────────────────────────────────────────────────────────╮ │ Streams │ ├─────────┬─────────────┬─────────────────────┬──────────┬───────┬──────────────┤ │ Name │ Description │ Created │ Messages │ Size │ Last Message │ ├─────────┼─────────────┼─────────────────────┼──────────┼───────┼──────────────┤ │ stream1 │ │ 2025-03-02 11:48:49 │ 3 │ 111 B │ 46.01s │ ╰─────────┴─────────────┴─────────────────────┴──────────┴───────┴──────────────╯
$ nats -s nats://localhost:4233 --user b --password b stream ls No Streams defined
$ du -h tmp/jetstream 0B tmp/jetstream/TEST/streams/stream1/obs 8.0K tmp/jetstream/TEST/streams/stream1/msgs 16K tmp/jetstream/TEST/streams/stream1 16K tmp/jetstream/TEST/streams 16K tmp/jetstream/TEST 16K tmp/jetstream
# User b (account TEST2) sends a PURGE command for account TEST (user a). # According to the source comments, user b shouldn't even be able to purge it's own account, much less another one. $ nats -s nats://localhost:4233 --user b --password b request '$JS.API.ACCOUNT.PURGE.TEST' '' 11:54:50 Sending request on "$JS.API.ACCOUNT.PURGE.TEST" 11:54:50 Received with rtt 1.528042ms {"type":"io.nats.jetstream.api.v1.account_purge_response","initiated":true}
# From nats-server in response to the purge request: [90608] 2025/03/02 11:54:50.277144 [INF] Purge request for account TEST (streams: 1, hasAccount: true)
# And indeed, the stream data is gone on account TEST: $ du -h tmp/jetstream 0B tmp/jetstream
$ nats -s nats://localhost:4233 --user a --password a stream ls No Streams defined
Incorrect Authorization
| Affected range | >=2.0.0 <2.7.2
| | Fixed version | 2.7.2 | | CVSS Score | 8.8 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | | EPSS Score | 0.548% | | EPSS Percentile | 67th percentile |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2022-24450.txt)
Problem Description
NATS nats-server through 2022-02-04 has Incorrect Access Control, with unchecked ability for clients to authorize into any account, because of a coding error in a long-extant experimental feature.
A client crafting the initial protocol-level handshake could, with valid credentials for any account, specify a target account and switch into it immediately. This includes any other tenant, and includes the System account which controls nats-server core operations.
For deployments not using multi-tenancy through NATS Accounts, there is still a vulnerability: normal users are able to choose to be in the System account.
An experimental feature to provide dynamically provisioned sandbox accounts was designed to allow a server administrator to turn on an option to allow clients to dynamically request a brand new account inline at connection time. This feature went nowhere, but lived on in the code and was used by a number of tests; support was never added to any client libraries or to the documentation.
A bug in handling the feature meant that if someone did in fact have valid account credentials, then they could specify any other existing account and they would be assigned into that account.
Release 2.7.2 of nats-server removes the feature.
Because of the lack of client support and absence from protocol documentation, we feel this is safe operationally as well as the safest fix for the code.
Affected versions
NATS Server
- All 2.x versions up to and including 2.7.1.
- Fixed with nats-io/nats-server: 2.7.2
- NATS Server 1.x did not have accounts.
- Docker image: nats https://hub.docker.com/_/nats
NATS Streaming Server
- All versions embedding affected NATS Server:
- Affected: v0.15.0 up to and including v0.24.0
- Fixed with nats-io/nats-streaming-server: 0.24.1
- Docker image: nats-streaming https://hub.docker.com/_/nats-streaming
Impact
Existing users could act in any account, including the System account.
Workaround
None.
Solution
Upgrade the NATS server.
Incorrect Authorization
| Affected range | <2.8.2 | | Fixed version | 2.8.2 | | CVSS Score | 7.1 | | CVSS Vector | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N | | EPSS Score | 0.108% | | EPSS Percentile | 30th percentile |
Description
NATS.io NATS Server before 2.8.2 and Streaming Server before 0.24.6 could allow a remote attacker to bypass security restrictions, caused by the failure to enforce negative user permissions in one scenario. By using a queue subscription on the wildcard, an attacker could exploit this vulnerability to allow denied subjects.
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
| Affected range | >=2.2.0 <2.7.4
| | Fixed version | 2.7.4 | | CVSS Score | 6.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N | | EPSS Score | 0.684% | | EPSS Percentile | 71st percentile |
Description
(This document is canonically: https://advisories.nats.io/CVE/CVE-2022-26652.txt)
Background
NATS.io is a high performance open source pub-sub distributed communication technology, built for the cloud, on-premise, IoT, and edge computing.
JetStream is the optional RAFT-based resilient persistent feature of NATS.
Problem Description
The JetStream streams can be backed up and restored via NATS. The backup format is a tar archive file. Inadequate checks on the filenames within the archive file permit a so-called "Zip Slip" attack in the stream restore.
NATS nats-server through 2022-03-09 (fixed in release 2.7.4) did not correctly sanitize elements of the archive file, thus a user of NATS
could cause the NATS server to write arbitrary content to an attacker-controlled filename.
Affected versions
NATS Server:
- 2.2.0 up to and including 2.7.3.
- Introduced with JetStream Restore functionality
- Fixed with nats-io/nats-server: 2.7.4
- Docker image: nats https://hub.docker.com/_/nats
- NB users of OS package files from our releases: a change in goreleaser defaults, discovered late in the release process, moved the install directory from /usr/local/bin to /usr/bin; we are evaluating the correct solution for subsequent releases, but not recutting this release.
NATS Streaming Server
- 0.15.0 up to and including 0.24.2
- Fixed with nats-io/nats-streaming-server: 0.24.3
- Embeds a nats-server, but this server is the old approach which JetStream replaces, so unlikely (but not impossible) to be
configured with JS support
Workarounds
- Disable JetStream for untrusted users.
- If only one NATS account uses JetStream, such that cross-user attacks are not an issue, and any user in that account with access to the JetStream API is fully trusted anyway, then appropriate sandboxing techniques will prevent exploit.
- Eg, with systemd, the supplied util/nats-server-hardened.service example configuration demonstrates that NATS runs fine as an unprivileged user under ProtectSystem=strict and PrivateTmp=true restrictions; by only opening a ReadWritePaths hole for the JetStream storage area, the impact of this vulnerability is limited.
Solution
Upgrade the NATS server to at least 2.7.4.
We fully support the util/nats-server-hardened.service configuration for running a NATS server and encourage this approach.
Credits
This issue was reported (on 2022-03-07) to the NATS Maintainers by
Yiming Xiang, TIANJI LAB of NSFOCUS.
Thank you / 谢谢你!
Authentication Bypass by Primary Weakness
| Affected range | >=2.2.0 <2.9.23
| | Fixed version | 2.9.23 | | EPSS Score | 0.212% | | EPSS Percentile | 44th percentile |
Description
Background
NATS.io is a high performance open source pub-sub distributed communication technology, built for the cloud, on-premise, IoT, and edge computing.
NATS users exist within accounts, and once using accounts, the old authorization block is not applicable.
Problem Description
Without any authorization rules in the nats-server, users can connect without authentication.
Before nats-server 2.2.0, all authentication and authorization rules for a nats-server lived in an "authorization" block, defining users. With nats-server 2.2.0 all users live inside accounts. When using the authorization block, whose syntax predates this, those users will be placed into the implicit global account, "$G". Users inside accounts go into the newer "accounts" block.
If an "accounts" block is defined, in simple deployment scenarios this is often used only to enable client access to the system account. When the only account added is the system account "$SYS", the nats-server would create an implicit user in "$G" and set it as the no_auth_user account, enabling the same "without authentication" logic as without any rules.
This preserved the ability to connect simply, and then add one authenticated login for system access.
But with an "authorization" block, this is wrong. Users exist in the global account, with login rules. And in simple testing, they might still connect fine without administrators seeing that authentication has been disabled.
The blind-spot on our part came from encouraging and documenting a switch to using only "accounts", instead of "authorization".
In the fixed versions, using an "authorization" block will inhibit the implicit creation of a "$G" user and setting it as the no_auth_user target. In unfixed versions, just creating a second account, with no users, will also inhibit this behavior.
Affected versions
NATS Server:
- 2.2.0 up to and including 2.9.22 and 2.10.1
- Fixed with nats-io/nats-server: 2.10.2 and backported to 2.9.23
Workarounds
In the "accounts" block, define a second non-system account, leave it empty.
accounts { SYS: { users: [ { user: sysuser, password: makemeasandwich } ] } DUMMY: {} # for security, before 2.10.2 } system_account: SYS
Solution
Any one of these:
- Upgrade the NATS server to at least 2.10.2 (or 2.9.23)
- Or define a dummy account
- Or complete the migration of authorization entries to be inside a named account in the "accounts" block
Credits
Problem reported by Alex Herrington.
Addressed publicly in a GitHub Discussion prior to this advisory.

| Affected range | <2.2.3 | | Fixed version | 2.2.3 |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2021-32026.txt)
Problem Description
The NATS server by default uses a restricted set of modern ciphersuites for TLS. This selection can be overridden through configuration. The defaults include just RSA and ECDSA with either AES/GCM with a SHA2 digest or ChaCha20/Poly1305.
The configuration system allows for extensive use of CLI options to override configuration settings. When using these to set a key/cert for TLS, the restricted ciphersuite settings were lost, enabling all ciphersuites supported by Go by default.
None of these additional ciphersuites are broken, so the NATS maintainers have fixed this in public git and the next release is not being hurried, nor is this security advisory embargoed.
Affected versions
NATS Server:
- All versions prior to 2.2.3
- fixed with nats-io/nats-server commit ffccc2e1bd (2021-04-29)
Impact
If a server administrator chooses to start the nats-server with TLS configuration parameters provided on the command-line, then clients can negotiate TLS ciphersuites which were not expected.
Workaround
Use a configuration file to set the TLS parameters instead of command-line options.
Solution
Upgrade the NATS server.
Credits
This issue was identified and reported by SimCorp.
|
openssl 1.1.1j-r0 (apk)
pkg:apk/alpine/openssl@1.1.1j-r0?os_name=alpine&os_version=3.13

| Affected range | <1.1.1l-r0 | | Fixed version | 1.1.1l-r0 | | EPSS Score | 2.352% | | EPSS Percentile | 84th percentile |
Description

| Affected range | <1.1.1n-r0 | | Fixed version | 1.1.1n-r0 | | EPSS Score | 7.070% | | EPSS Percentile | 91st percentile |
Description

| Affected range | <1.1.1l-r0 | | Fixed version | 1.1.1l-r0 | | EPSS Score | 0.486% | | EPSS Percentile | 65th percentile |
Description

| Affected range | <1.1.1k-r0 | | Fixed version | 1.1.1k-r0 | | EPSS Score | 0.568% | | EPSS Percentile | 68th percentile |
Description

| Affected range | <1.1.1k-r0 | | Fixed version | 1.1.1k-r0 | | EPSS Score | 10.188% | | EPSS Percentile | 93rd percentile |
Description

| Affected range | <1.1.1q-r0 | | Fixed version | 1.1.1q-r0 | | EPSS Score | 0.407% | | EPSS Percentile | 60th percentile |
Description
|
apk-tools 2.12.1-r0 (apk)
pkg:apk/alpine/apk-tools@2.12.1-r0?os_name=alpine&os_version=3.13

| Affected range | <2.12.6-r0 | | Fixed version | 2.12.6-r0 | | EPSS Score | 0.573% | | EPSS Percentile | 68th percentile |
Description

| Affected range | <2.12.5-r0 | | Fixed version | 2.12.5-r0 | | EPSS Score | 0.192% | | EPSS Percentile | 41st percentile |
Description
|
zlib 1.2.11-r3 (apk)
pkg:apk/alpine/zlib@1.2.11-r3?os_name=alpine&os_version=3.13

| Affected range | <1.2.12-r2 | | Fixed version | 1.2.12-r2 | | EPSS Score | 92.470% | | EPSS Percentile | 100th percentile |
Description

| Affected range | <1.2.12-r0 | | Fixed version | 1.2.12-r0 | | EPSS Score | 0.093% | | EPSS Percentile | 27th percentile |
Description
|
github.com/nats-io/jwt 1.1.0 (golang)
pkg:golang/github.com/nats-io/jwt@1.1.0
Incorrect Authorization
| Affected range | <=1.2.2 | | Fixed version | Not Fixed | | EPSS Score | 0.290% | | EPSS Percentile | 52nd percentile |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2021-3127.txt)
Problem Description
The NATS server provides for Subjects which are namespaced by Account; all Subjects are supposed to be private to an account, with an Export/Import system used to grant cross-account access to some Subjects. Some Exports are public, such that anyone can import the
relevant subjects, and some Exports are private, such that the Import requires a token JWT to prove permission.
The JWT library's validation of the bindings in the Import Token incorrectly warned on mismatches, instead of outright rejecting the token.
As a result, any account can take an Import token used by any other account and re-use it for themselves because the binding to the
importing account is not rejected, and use it to import any Subject from the Exporting account, not just the Subject referenced in the Import Token.
The NATS account-server system treats account JWTs as semi-public information, such that an attacker can easily enumerate all account JWTs and retrieve all Import Tokens from those account JWTs.
The CVE identifier should cover the JWT library repair and the nats-server containing the fixed JWT library, and any other application depending upon the fixed JWT library.
Affected versions
JWT library
- all versions prior to 2.0.1
- fixed after nats-io/jwt#149 landed (2021-03-14)
NATS Server
- Version 2 prior to 2.2.0
- 2.0.0 through and including 2.1.9 are vulnerable
- fixed with nats-io/nats-server@423b79440c (2021-03-14)
Impact
In deployments with untrusted accounts able to update the Account Server with imports, a malicious account can access any Subject from an account which provides Exported Subjects.
Abuse of this facility requires the malicious actor to upload their tampered Account JWT to the Account Server, providing the service operator with a data-store which can be scanned for signs of abuse.
Workaround
Deny access to clients to update their account JWT in the account server.
Solution
Upgrade the JWT dependency in any application using it.
Upgrade the NATS server if using NATS Accounts (with private Exports; Account owners can create those at any time though).
Audit all accounts JWTs to scan for exploit attempts; a Python script to audit the accounts can be found at https://gist.github.com/philpennock/09d49524ad98043ff11d8a40c2bb0d5a.
OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
| Affected range | <v1.2.3-0.20210314221642-a826c77dc9d2 | | Fixed version | v1.2.3-0.20210314221642-a826c77dc9d2 |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2021-3127.txt)
Problem Description
The NATS server provides for Subjects which are namespaced by Account; all Subjects are supposed to be private to an account, with an Export/Import system used to grant cross-account access to some Subjects. Some Exports are public, such that anyone can import the relevant subjects, and some Exports are private, such that the Import requires a token JWT to prove permission.
The JWT library's validation of the bindings in the Import Token incorrectly warned on mismatches, instead of outright rejecting the token.
As a result, any account can take an Import token used by any other account and re-use it for themselves because the binding to the importing account is not rejected, and use it to import any Subject from the Exporting account, not just the Subject referenced in the Import Token.
The NATS account-server system treats account JWTs as semi-public information, such that an attacker can easily enumerate all account JWTs and retrieve all Import Tokens from those account JWTs.
The CVE identifier should cover the JWT library repair and the nats-server containing the fixed JWT library, and any other application depending upon the fixed JWT library.
Affected versions
JWT library
- all versions prior to 2.0.1
- fixed after nats-io/jwt#149 landed (2021-03-14)
NATS Server
- 2.0.0 through and including 2.1.9 is vulnerable
- fixed with nats-io/nats-server@423b79440c (2021-03-14)
Impact
In deployments with untrusted accounts able to update the Account Server with imports, a malicious account can access any Subject from an account which provides Exported Subjects.
Abuse of this facility requires the malicious actor to upload their tampered Account JWT to the Account Server, providing the service operator with a data-store which can be scanned for signs of abuse.
Workaround
Deny access to clients to update their account JWT in the account server.
Solution
Upgrade the JWT dependency in any application using it.
Upgrade the NATS server if using NATS Accounts (with private Exports; Account owners can create those at any time though).
Audit all accounts JWTs to scan for exploit attempts; a Python script to audit the accounts can be found at https://gist.github.com/philpennock/09d49524ad98043ff11d8a40c2bb0d5a.
|
github.com/nats-io/jwt 1.2.2 (golang)
pkg:golang/github.com/nats-io/jwt@1.2.2
Incorrect Authorization
| Affected range | <=1.2.2 | | Fixed version | Not Fixed | | EPSS Score | 0.290% | | EPSS Percentile | 52nd percentile |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2021-3127.txt)
Problem Description
The NATS server provides for Subjects which are namespaced by Account; all Subjects are supposed to be private to an account, with an Export/Import system used to grant cross-account access to some Subjects. Some Exports are public, such that anyone can import the
relevant subjects, and some Exports are private, such that the Import requires a token JWT to prove permission.
The JWT library's validation of the bindings in the Import Token incorrectly warned on mismatches, instead of outright rejecting the token.
As a result, any account can take an Import token used by any other account and re-use it for themselves because the binding to the
importing account is not rejected, and use it to import any Subject from the Exporting account, not just the Subject referenced in the Import Token.
The NATS account-server system treats account JWTs as semi-public information, such that an attacker can easily enumerate all account JWTs and retrieve all Import Tokens from those account JWTs.
The CVE identifier should cover the JWT library repair and the nats-server containing the fixed JWT library, and any other application depending upon the fixed JWT library.
Affected versions
JWT library
- all versions prior to 2.0.1
- fixed after nats-io/jwt#149 landed (2021-03-14)
NATS Server
- Version 2 prior to 2.2.0
- 2.0.0 through and including 2.1.9 are vulnerable
- fixed with nats-io/nats-server@423b79440c (2021-03-14)
Impact
In deployments with untrusted accounts able to update the Account Server with imports, a malicious account can access any Subject from an account which provides Exported Subjects.
Abuse of this facility requires the malicious actor to upload their tampered Account JWT to the Account Server, providing the service operator with a data-store which can be scanned for signs of abuse.
Workaround
Deny access to clients to update their account JWT in the account server.
Solution
Upgrade the JWT dependency in any application using it.
Upgrade the NATS server if using NATS Accounts (with private Exports; Account owners can create those at any time though).
Audit all accounts JWTs to scan for exploit attempts; a Python script to audit the accounts can be found at https://gist.github.com/philpennock/09d49524ad98043ff11d8a40c2bb0d5a.
OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
| Affected range | <v1.2.3-0.20210314221642-a826c77dc9d2 | | Fixed version | v1.2.3-0.20210314221642-a826c77dc9d2 |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2021-3127.txt)
Problem Description
The NATS server provides for Subjects which are namespaced by Account; all Subjects are supposed to be private to an account, with an Export/Import system used to grant cross-account access to some Subjects. Some Exports are public, such that anyone can import the relevant subjects, and some Exports are private, such that the Import requires a token JWT to prove permission.
The JWT library's validation of the bindings in the Import Token incorrectly warned on mismatches, instead of outright rejecting the token.
As a result, any account can take an Import token used by any other account and re-use it for themselves because the binding to the importing account is not rejected, and use it to import any Subject from the Exporting account, not just the Subject referenced in the Import Token.
The NATS account-server system treats account JWTs as semi-public information, such that an attacker can easily enumerate all account JWTs and retrieve all Import Tokens from those account JWTs.
The CVE identifier should cover the JWT library repair and the nats-server containing the fixed JWT library, and any other application depending upon the fixed JWT library.
Affected versions
JWT library
- all versions prior to 2.0.1
- fixed after nats-io/jwt#149 landed (2021-03-14)
NATS Server
- 2.0.0 through and including 2.1.9 is vulnerable
- fixed with nats-io/nats-server@423b79440c (2021-03-14)
Impact
In deployments with untrusted accounts able to update the Account Server with imports, a malicious account can access any Subject from an account which provides Exported Subjects.
Abuse of this facility requires the malicious actor to upload their tampered Account JWT to the Account Server, providing the service operator with a data-store which can be scanned for signs of abuse.
Workaround
Deny access to clients to update their account JWT in the account server.
Solution
Upgrade the JWT dependency in any application using it.
Upgrade the NATS server if using NATS Accounts (with private Exports; Account owners can create those at any time though).
Audit all accounts JWTs to scan for exploit attempts; a Python script to audit the accounts can be found at https://gist.github.com/philpennock/09d49524ad98043ff11d8a40c2bb0d5a.
|
busybox 1.32.1-r3 (apk)
pkg:apk/alpine/busybox@1.32.1-r3?os_name=alpine&os_version=3.13

| Affected range | <1.32.1-r8 | | Fixed version | 1.32.1-r8 | | EPSS Score | 3.543% | | EPSS Percentile | 87th percentile |
Description

| Affected range | <1.32.1-r9 | | Fixed version | 1.32.1-r9 | | EPSS Score | 0.636% | | EPSS Percentile | 70th percentile |
Description

| Affected range | <1.32.1-r4 | | Fixed version | 1.32.1-r4 | | EPSS Score | 1.019% | | EPSS Percentile | 77th percentile |
Description

| Affected range | <1.32.1-r7 | | Fixed version | 1.32.1-r7 | | EPSS Score | 0.294% | | EPSS Percentile | 52nd percentile |
Description

| Affected range | <1.32.1-r7 | | Fixed version | 1.32.1-r7 | | EPSS Score | 0.294% | | EPSS Percentile | 52nd percentile |
Description

| Affected range | <1.32.1-r7 | | Fixed version | 1.32.1-r7 | | EPSS Score | 0.237% | | EPSS Percentile | 47th percentile |
Description

| Affected range | <1.32.1-r7 | | Fixed version | 1.32.1-r7 | | EPSS Score | 0.300% | | EPSS Percentile | 53rd percentile |
Description

| Affected range | <1.32.1-r7 | | Fixed version | 1.32.1-r7 | | EPSS Score | 0.321% | | EPSS Percentile | 55th percentile |
Description

| Affected range | <1.32.1-r7 | | Fixed version | 1.32.1-r7 | | EPSS Score | 0.321% | | EPSS Percentile | 55th percentile |
Description

| Affected range | <1.32.1-r7 | | Fixed version | 1.32.1-r7 | | EPSS Score | 0.453% | | EPSS Percentile | 63rd percentile |
Description

| Affected range | <1.32.1-r7 | | Fixed version | 1.32.1-r7 | | EPSS Score | 0.237% | | EPSS Percentile | 47th percentile |
Description

| Affected range | <1.32.1-r7 | | Fixed version | 1.32.1-r7 | | EPSS Score | 0.237% | | EPSS Percentile | 47th percentile |
Description

| Affected range | <1.32.1-r7 | | Fixed version | 1.32.1-r7 | | EPSS Score | 0.061% | | EPSS Percentile | 19th percentile |
Description

| Affected range | <1.32.1-r7 | | Fixed version | 1.32.1-r7 | | EPSS Score | 0.054% | | EPSS Percentile | 17th percentile |
Description

| Affected range | <1.32.1-r8 | | Fixed version | 1.32.1-r8 |
Description
|
github.com/nats-io/nats-server/v2 2.1.9 (golang)
pkg:golang/github.com/nats-io/nats-server@2.1.9#v2
Incorrect Authorization
| Affected range | >=2.0.0 <2.7.2
| | Fixed version | 2.7.2 | | CVSS Score | 8.8 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H | | EPSS Score | 0.548% | | EPSS Percentile | 67th percentile |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2022-24450.txt)
Problem Description
NATS nats-server through 2022-02-04 has Incorrect Access Control, with unchecked ability for clients to authorize into any account, because of a coding error in a long-extant experimental feature.
A client crafting the initial protocol-level handshake could, with valid credentials for any account, specify a target account and switch into it immediately. This includes any other tenant, and includes the System account which controls nats-server core operations.
For deployments not using multi-tenancy through NATS Accounts, there is still a vulnerability: normal users are able to choose to be in the System account.
An experimental feature to provide dynamically provisioned sandbox accounts was designed to allow a server administrator to turn on an option to allow clients to dynamically request a brand new account inline at connection time. This feature went nowhere, but lived on in the code and was used by a number of tests; support was never added to any client libraries or to the documentation.
A bug in handling the feature meant that if someone did in fact have valid account credentials, then they could specify any other existing account and they would be assigned into that account.
Release 2.7.2 of nats-server removes the feature.
Because of the lack of client support and absence from protocol documentation, we feel this is safe operationally as well as the safest fix for the code.
Affected versions
NATS Server
- All 2.x versions up to and including 2.7.1.
- Fixed with nats-io/nats-server: 2.7.2
- NATS Server 1.x did not have accounts.
- Docker image: nats https://hub.docker.com/_/nats
NATS Streaming Server
- All versions embedding affected NATS Server:
- Affected: v0.15.0 up to and including v0.24.0
- Fixed with nats-io/nats-streaming-server: 0.24.1
- Docker image: nats-streaming https://hub.docker.com/_/nats-streaming
Impact
Existing users could act in any account, including the System account.
Workaround
None.
Solution
Upgrade the NATS server.
Improper Handling of Exceptional Conditions
| Affected range | <2.2.0 | | Fixed version | 2.2.0 | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2021-3127.txt)
Problem Description
The NATS server provides for Subjects which are namespaced by Account; all Subjects are supposed to be private to an account, with an Export/Import system used to grant cross-account access to some Subjects. Some Exports are public, such that anyone can import the relevant subjects, and some Exports are private, such that the Import requires a token JWT to prove permission.
The JWT library's validation of the bindings in the Import Token incorrectly warned on mismatches, instead of outright rejecting the token.
As a result, any account can take an Import token used by any other account and re-use it for themselves because the binding to the importing account is not rejected, and use it to import any Subject from the Exporting account, not just the Subject referenced in the Import Token.
The NATS account-server system treats account JWTs as semi-public information, such that an attacker can easily enumerate all account JWTs and retrieve all Import Tokens from those account JWTs.
The CVE identifier should cover the JWT library repair and the nats-server containing the fixed JWT library, and any other application depending upon the fixed JWT library.
Affected versions
JWT library
- all versions prior to 2.0.1
- fixed after nats-io/jwt#149 landed (2021-03-14)
NATS Server
- Version 2 prior to 2.2.0
- 2.0.0 through and including 2.1.9 are vulnerable
- fixed with nats-io/nats-server@423b79440c (2021-03-14)
Impact
In deployments with untrusted accounts able to update the Account Server with imports, a malicious account can access any Subject from an account which provides Exported Subjects.
Abuse of this facility requires the malicious actor to upload their tampered Account JWT to the Account Server, providing the service operator with a data-store which can be scanned for signs of abuse.
Workaround
Deny access to clients to update their account JWT in the account server.
Solution
Upgrade the JWT dependency in any application using it.
Upgrade the NATS server if using NATS Accounts (with private Exports; Account owners can create those at any time though).
Audit all accounts JWTs to scan for exploit attempts; a Python script to audit the accounts can be found at https://gist.github.com/philpennock/09d49524ad98043ff11d8a40c2bb0d5a.
Improper Access Control
| Affected range | <2.2.0 | | Fixed version | 2.2.0 | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N | | EPSS Score | 0.290% | | EPSS Percentile | 52nd percentile |
Description
NATS Server (github.com/nats-io/nats-server/v2/server) 2.x before 2.2.0 and JWT library (github.com/nats-io/jwt/v2) before 2.0.1 have Incorrect Access Control because Import Token bindings are mishandled.
Uncontrolled Resource Consumption
| Affected range | <2.2.0 | | Fixed version | 2.2.0 | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 8.427% | | EPSS Percentile | 92nd percentile |
Description
This affects all versions of package github.com/nats-io/nats-server/server. Untrusted accounts are able to crash the server using configs that represent a service export/import cycles. Disclaimer from the maintainers - Running a NATS service which is exposed to untrusted users presents a heightened risk. Any remote execution flaw or equivalent seriousness, or denial-of-service by unauthenticated users, will lead to prompt releases by the NATS maintainers. Fixes for denial of service issues with no threat of remote execution, when limited to account holders, are likely to just be committed to the main development branch with no special attention. Those who are running such services are encouraged to build regularly from git.
Integer Overflow or Wraparound
| Affected range | <2.2.0 | | Fixed version | 2.2.0 | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.678% | | EPSS Percentile | 71st percentile |
Description
An integer overflow in NATS Server before 2.2.0 allows a remote attacker to crash the server by sending a crafted request.
Specific Go Packages Affected
github.com/nats-io/nats-server/v2/server
Incorrect Authorization
| Affected range | <2.8.2 | | Fixed version | 2.8.2 | | CVSS Score | 7.1 | | CVSS Vector | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N | | EPSS Score | 0.108% | | EPSS Percentile | 30th percentile |
Description
NATS.io NATS Server before 2.8.2 and Streaming Server before 0.24.6 could allow a remote attacker to bypass security restrictions, caused by the failure to enforce negative user permissions in one scenario. By using a queue subscription on the wildcard, an attacker could exploit this vulnerability to allow denied subjects.
Uncontrolled Resource Consumption
| Affected range | <2.2.0 | | Fixed version | 2.2.0 | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2020-28466.txt)
Problem Description
An export/import cycle between accounts could crash the nats-server, after consuming CPU and memory.
This issue was fixed publicly in https://github.com/nats-io/nats-server/pull/1731 in November 2020.
The need to call this out as a security issue was highlighted by snyk.io and we are grateful for their assistance in doing so.
Organizations which run a NATS service providing access to accounts run by untrusted third parties are affected.
See below for an important caveat if running such a service.
Affected versions
NATS Server
- Version 2 prior to 2.2.0
- 2.0.0 through and including 2.1.9 are vulnerable.
- fixed with nats-io/nats-server PR 1731, commit 2e3c226729
Impact
The nats-server could be killed, after consuming resources.
Workaround
The import cycle requires at least two accounts to work; if you have open account sign-up, then restricting new account sign-up might hinder an attacker.
Solution
Upgrade the nats-server.
Caveat on NATS with untrusted users
Running a NATS service which is exposed to untrusted users presents a heightened risk.
Any remote execution flaw or equivalent seriousness, or denial-of-service by unauthenticated users, will lead to prompt releases by the NATS maintainers.
Fixes for denial of service issues with no threat of remote execution, when limited to account holders, are likely to just be committed to the main development branch with no special attention.
Those who are running such services are encouraged to build regularly from git.

| Affected range | <2.2.3 | | Fixed version | 2.2.3 |
Description
(This advisory is canonically https://advisories.nats.io/CVE/CVE-2021-32026.txt)
Problem Description
The NATS server by default uses a restricted set of modern ciphersuites for TLS. This selection can be overridden through configuration. The defaults include just RSA and ECDSA with either AES/GCM with a SHA2 digest or ChaCha20/Poly1305.
The configuration system allows for extensive use of CLI options to override configuration settings. When using these to set a key/cert for TLS, the restricted ciphersuite settings were lost, enabling all ciphersuites supported by Go by default.
None of these additional ciphersuites are broken, so the NATS maintainers have fixed this in public git and the next release is not being hurried, nor is this security advisory embargoed.
Affected versions
NATS Server:
- All versions prior to 2.2.3
- fixed with nats-io/nats-server commit ffccc2e1bd (2021-04-29)
Impact
If a server administrator chooses to start the nats-server with TLS configuration parameters provided on the command-line, then clients can negotiate TLS ciphersuites which were not expected.
Workaround
Use a configuration file to set the TLS parameters instead of command-line options.
Solution
Upgrade the NATS server.
Credits
This issue was identified and reported by SimCorp.
|
golang.org/x/crypto 0.0.0-20200323165209-0ec3e9974c59 (golang)
pkg:golang/golang.org/x/crypto@0.0.0-20200323165209-0ec3e9974c59

| Affected range | <0.0.0-20220525230936-793ad666bf5e | | Fixed version | 0.0.0-20220525230936-793ad666bf5e | | EPSS Score | 0.247% | | EPSS Percentile | 48th percentile |
Description
httpTokenCacheKey uses path.Base to extract the expected HTTP-01 token value to lookup in the DirCache implementation. On Windows, path.Base acts differently to filepath.Base, since Windows uses a different path separator (\ vs. /), allowing a user to provide a relative path, i.e. .well-known/acme-challenge/....\asd becomes ....\asd. The extracted path is then suffixed with +http-01, joined with the cache directory, and opened.
Since the controlled path is suffixed with +http-01 before opening, the impact of this is significantly limited, since it only allows reading arbitrary files on the system if and only if they have this suffix.
Use of a Broken or Risky Cryptographic Algorithm
| Affected range | <0.0.0-20220314234659-1baeb1ce4c0b | | Fixed version | 0.0.0-20220314234659-1baeb1ce4c0b | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.089% | | EPSS Percentile | 26th percentile |
Description
The golang.org/x/crypto/ssh package before 0.0.0-20220314234659-1baeb1ce4c0b for Go allows an attacker to crash a server in certain circumstances involving AddHostKey.

| Affected range | <0.0.0-20211202192323-5770296d904e | | Fixed version | 0.0.0-20211202192323-5770296d904e | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.022% | | EPSS Percentile | 5th percentile |
Description
The x/crypto/ssh package before 0.0.0-20211202192323-5770296d904e of golang.org/x/crypto allows an unauthenticated attacker to panic an SSH server. When using AES-GCM or ChaCha20Poly1305, consuming a malformed packet which contains an empty plaintext causes a panic.
NULL Pointer Dereference
| Affected range | <0.0.0-20201216223049-8b5274cf687f | | Fixed version | 0.0.0-20201216223049-8b5274cf687f | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.069% | | EPSS Percentile | 21st percentile |
Description
A nil pointer dereference in the golang.org/x/crypto/ssh component through v0.0.0-20201203163018-be400aefbc4c for Go allows remote attackers to cause a denial of service against SSH servers. An attacker can craft an authentication request message for the gssapi-with-mic method which will cause NewServerConn to panic via a nil pointer dereference if ServerConfig.GSSAPIWithMICConfig is nil.
Insufficient Verification of Data Authenticity
| Affected range | <0.0.0-20231218163308-9d2ee975ef9f | | Fixed version | 0.0.0-20231218163308-9d2ee975ef9f | | CVSS Score | 5.9 | | CVSS Vector | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | | EPSS Score | 55.964% | | EPSS Percentile | 98th percentile |
Description
Summary
Terrapin is a prefix truncation attack targeting the SSH protocol. More precisely, Terrapin breaks the integrity of SSH's secure channel. By carefully adjusting the sequence numbers during the handshake, an attacker can remove an arbitrary amount of messages sent by the client or server at the beginning of the secure channel without the client or server noticing it.
Mitigations
To mitigate this protocol vulnerability, OpenSSH suggested a so-called "strict kex" which alters the SSH handshake to ensure a Man-in-the-Middle attacker cannot introduce unauthenticated messages as well as convey sequence number manipulation across handshakes.
Warning: To take effect, both the client and server must support this countermeasure.
As a stop-gap measure, peers may also (temporarily) disable the affected algorithms and use unaffected alternatives like AES-GCM instead until patches are available.
Details
The SSH specifications of ChaCha20-Poly1305 (chacha20-poly1305@openssh.com) and Encrypt-then-MAC (*-etm@openssh.com MACs) are vulnerable against an arbitrary prefix truncation attack (a.k.a. Terrapin attack). This allows for an extension negotiation downgrade by stripping the SSH_MSG_EXT_INFO sent after the first message after SSH_MSG_NEWKEYS, downgrading security, and disabling attack countermeasures in some versions of OpenSSH. When targeting Encrypt-then-MAC, this attack requires the use of a CBC cipher to be practically exploitable due to the internal workings of the cipher mode. Additionally, this novel attack technique can be used to exploit previously unexploitable implementation flaws in a Man-in-the-Middle scenario.
The attack works by an attacker injecting an arbitrary number of SSH_MSG_IGNORE messages during the initial key exchange and consequently removing the same number of messages just after the initial key exchange has concluded. This is possible due to missing authentication of the excess SSH_MSG_IGNORE messages and the fact that the implicit sequence numbers used within the SSH protocol are only checked after the initial key exchange.
In the case of ChaCha20-Poly1305, the attack is guaranteed to work on every connection as this cipher does not maintain an internal state other than the message's sequence number. In the case of Encrypt-Then-MAC, practical exploitation requires the use of a CBC cipher; while theoretical integrity is broken for all ciphers when using this mode, message processing will fail at the application layer for CTR and stream ciphers.
For more details see https://terrapin-attack.com.
Impact
This attack targets the specification of ChaCha20-Poly1305 (chacha20-poly1305@openssh.com) and Encrypt-then-MAC (*-etm@openssh.com), which are widely adopted by well-known SSH implementations and can be considered de-facto standard. These algorithms can be practically exploited; however, in the case of Encrypt-Then-MAC, we additionally require the use of a CBC cipher. As a consequence, this attack works against all well-behaving SSH implementations supporting either of those algorithms and can be used to downgrade (but not fully strip) connection security in case SSH extension negotiation (RFC8308) is supported. The attack may also enable attackers to exploit certain implementation flaws in a man-in-the-middle (MitM) scenario.
|
golang.org/x/crypto 0.0.0-20200622213623-75b288015ac9 (golang)
pkg:golang/golang.org/x/crypto@0.0.0-20200622213623-75b288015ac9

| Affected range | <0.0.0-20220525230936-793ad666bf5e | | Fixed version | 0.0.0-20220525230936-793ad666bf5e | | EPSS Score | 0.247% | | EPSS Percentile | 48th percentile |
Description
httpTokenCacheKey uses path.Base to extract the expected HTTP-01 token value to lookup in the DirCache implementation. On Windows, path.Base acts differently to filepath.Base, since Windows uses a different path separator (\ vs. /), allowing a user to provide a relative path, i.e. .well-known/acme-challenge/....\asd becomes ....\asd. The extracted path is then suffixed with +http-01, joined with the cache directory, and opened.
Since the controlled path is suffixed with +http-01 before opening, the impact of this is significantly limited, since it only allows reading arbitrary files on the system if and only if they have this suffix.
Use of a Broken or Risky Cryptographic Algorithm
| Affected range | <0.0.0-20220314234659-1baeb1ce4c0b | | Fixed version | 0.0.0-20220314234659-1baeb1ce4c0b | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.089% | | EPSS Percentile | 26th percentile |
Description
The golang.org/x/crypto/ssh package before 0.0.0-20220314234659-1baeb1ce4c0b for Go allows an attacker to crash a server in certain circumstances involving AddHostKey.

| Affected range | <0.0.0-20211202192323-5770296d904e | | Fixed version | 0.0.0-20211202192323-5770296d904e | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.022% | | EPSS Percentile | 5th percentile |
Description
The x/crypto/ssh package before 0.0.0-20211202192323-5770296d904e of golang.org/x/crypto allows an unauthenticated attacker to panic an SSH server. When using AES-GCM or ChaCha20Poly1305, consuming a malformed packet which contains an empty plaintext causes a panic.
NULL Pointer Dereference
| Affected range | <0.0.0-20201216223049-8b5274cf687f | | Fixed version | 0.0.0-20201216223049-8b5274cf687f | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.069% | | EPSS Percentile | 21st percentile |
Description
A nil pointer dereference in the golang.org/x/crypto/ssh component through v0.0.0-20201203163018-be400aefbc4c for Go allows remote attackers to cause a denial of service against SSH servers. An attacker can craft an authentication request message for the gssapi-with-mic method which will cause NewServerConn to panic via a nil pointer dereference if ServerConfig.GSSAPIWithMICConfig is nil.
Insufficient Verification of Data Authenticity
| Affected range | <0.0.0-20231218163308-9d2ee975ef9f | | Fixed version | 0.0.0-20231218163308-9d2ee975ef9f | | CVSS Score | 5.9 | | CVSS Vector | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | | EPSS Score | 55.964% | | EPSS Percentile | 98th percentile |
Description
Summary
Terrapin is a prefix truncation attack targeting the SSH protocol. More precisely, Terrapin breaks the integrity of SSH's secure channel. By carefully adjusting the sequence numbers during the handshake, an attacker can remove an arbitrary amount of messages sent by the client or server at the beginning of the secure channel without the client or server noticing it.
Mitigations
To mitigate this protocol vulnerability, OpenSSH suggested a so-called "strict kex" which alters the SSH handshake to ensure a Man-in-the-Middle attacker cannot introduce unauthenticated messages as well as convey sequence number manipulation across handshakes.
Warning: To take effect, both the client and server must support this countermeasure.
As a stop-gap measure, peers may also (temporarily) disable the affected algorithms and use unaffected alternatives like AES-GCM instead until patches are available.
Details
The SSH specifications of ChaCha20-Poly1305 (chacha20-poly1305@openssh.com) and Encrypt-then-MAC (*-etm@openssh.com MACs) are vulnerable against an arbitrary prefix truncation attack (a.k.a. Terrapin attack). This allows for an extension negotiation downgrade by stripping the SSH_MSG_EXT_INFO sent after the first message after SSH_MSG_NEWKEYS, downgrading security, and disabling attack countermeasures in some versions of OpenSSH. When targeting Encrypt-then-MAC, this attack requires the use of a CBC cipher to be practically exploitable due to the internal workings of the cipher mode. Additionally, this novel attack technique can be used to exploit previously unexploitable implementation flaws in a Man-in-the-Middle scenario.
The attack works by an attacker injecting an arbitrary number of SSH_MSG_IGNORE messages during the initial key exchange and consequently removing the same number of messages just after the initial key exchange has concluded. This is possible due to missing authentication of the excess SSH_MSG_IGNORE messages and the fact that the implicit sequence numbers used within the SSH protocol are only checked after the initial key exchange.
In the case of ChaCha20-Poly1305, the attack is guaranteed to work on every connection as this cipher does not maintain an internal state other than the message's sequence number. In the case of Encrypt-Then-MAC, practical exploitation requires the use of a CBC cipher; while theoretical integrity is broken for all ciphers when using this mode, message processing will fail at the application layer for CTR and stream ciphers.
For more details see https://terrapin-attack.com.
Impact
This attack targets the specification of ChaCha20-Poly1305 (chacha20-poly1305@openssh.com) and Encrypt-then-MAC (*-etm@openssh.com), which are widely adopted by well-known SSH implementations and can be considered de-facto standard. These algorithms can be practically exploited; however, in the case of Encrypt-Then-MAC, we additionally require the use of a CBC cipher. As a consequence, this attack works against all well-behaving SSH implementations supporting either of those algorithms and can be used to downgrade (but not fully strip) connection security in case SSH extension negotiation (RFC8308) is supported. The attack may also enable attackers to exploit certain implementation flaws in a man-in-the-middle (MitM) scenario.
|
golang.org/x/crypto 0.0.0-20210421170649-83a5a9bb288b (golang)
pkg:golang/golang.org/x/crypto@0.0.0-20210421170649-83a5a9bb288b

| Affected range | <0.0.0-20220525230936-793ad666bf5e | | Fixed version | 0.0.0-20220525230936-793ad666bf5e | | EPSS Score | 0.247% | | EPSS Percentile | 48th percentile |
Description
httpTokenCacheKey uses path.Base to extract the expected HTTP-01 token value to lookup in the DirCache implementation. On Windows, path.Base acts differently to filepath.Base, since Windows uses a different path separator (\ vs. /), allowing a user to provide a relative path, i.e. .well-known/acme-challenge/....\asd becomes ....\asd. The extracted path is then suffixed with +http-01, joined with the cache directory, and opened.
Since the controlled path is suffixed with +http-01 before opening, the impact of this is significantly limited, since it only allows reading arbitrary files on the system if and only if they have this suffix.
Use of a Broken or Risky Cryptographic Algorithm
| Affected range | <0.0.0-20220314234659-1baeb1ce4c0b | | Fixed version | 0.0.0-20220314234659-1baeb1ce4c0b | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.089% | | EPSS Percentile | 26th percentile |
Description
The golang.org/x/crypto/ssh package before 0.0.0-20220314234659-1baeb1ce4c0b for Go allows an attacker to crash a server in certain circumstances involving AddHostKey.

| Affected range | <0.0.0-20211202192323-5770296d904e | | Fixed version | 0.0.0-20211202192323-5770296d904e | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.022% | | EPSS Percentile | 5th percentile |
Description
The x/crypto/ssh package before 0.0.0-20211202192323-5770296d904e of golang.org/x/crypto allows an unauthenticated attacker to panic an SSH server. When using AES-GCM or ChaCha20Poly1305, consuming a malformed packet which contains an empty plaintext causes a panic.
Insufficient Verification of Data Authenticity
| Affected range | <0.0.0-20231218163308-9d2ee975ef9f | | Fixed version | 0.0.0-20231218163308-9d2ee975ef9f | | CVSS Score | 5.9 | | CVSS Vector | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N | | EPSS Score | 55.964% | | EPSS Percentile | 98th percentile |
Description
Summary
Terrapin is a prefix truncation attack targeting the SSH protocol. More precisely, Terrapin breaks the integrity of SSH's secure channel. By carefully adjusting the sequence numbers during the handshake, an attacker can remove an arbitrary amount of messages sent by the client or server at the beginning of the secure channel without the client or server noticing it.
Mitigations
To mitigate this protocol vulnerability, OpenSSH suggested a so-called "strict kex" which alters the SSH handshake to ensure a Man-in-the-Middle attacker cannot introduce unauthenticated messages as well as convey sequence number manipulation across handshakes.
Warning: To take effect, both the client and server must support this countermeasure.
As a stop-gap measure, peers may also (temporarily) disable the affected algorithms and use unaffected alternatives like AES-GCM instead until patches are available.
Details
The SSH specifications of ChaCha20-Poly1305 (chacha20-poly1305@openssh.com) and Encrypt-then-MAC (*-etm@openssh.com MACs) are vulnerable against an arbitrary prefix truncation attack (a.k.a. Terrapin attack). This allows for an extension negotiation downgrade by stripping the SSH_MSG_EXT_INFO sent after the first message after SSH_MSG_NEWKEYS, downgrading security, and disabling attack countermeasures in some versions of OpenSSH. When targeting Encrypt-then-MAC, this attack requires the use of a CBC cipher to be practically exploitable due to the internal workings of the cipher mode. Additionally, this novel attack technique can be used to exploit previously unexploitable implementation flaws in a Man-in-the-Middle scenario.
The attack works by an attacker injecting an arbitrary number of SSH_MSG_IGNORE messages during the initial key exchange and consequently removing the same number of messages just after the initial key exchange has concluded. This is possible due to missing authentication of the excess SSH_MSG_IGNORE messages and the fact that the implicit sequence numbers used within the SSH protocol are only checked after the initial key exchange.
In the case of ChaCha20-Poly1305, the attack is guaranteed to work on every connection as this cipher does not maintain an internal state other than the message's sequence number. In the case of Encrypt-Then-MAC, practical exploitation requires the use of a CBC cipher; while theoretical integrity is broken for all ciphers when using this mode, message processing will fail at the application layer for CTR and stream ciphers.
For more details see https://terrapin-attack.com.
Impact
This attack targets the specification of ChaCha20-Poly1305 (chacha20-poly1305@openssh.com) and Encrypt-then-MAC (*-etm@openssh.com), which are widely adopted by well-known SSH implementations and can be considered de-facto standard. These algorithms can be practically exploited; however, in the case of Encrypt-Then-MAC, we additionally require the use of a CBC cipher. As a consequence, this attack works against all well-behaving SSH implementations supporting either of those algorithms and can be used to downgrade (but not fully strip) connection security in case SSH extension negotiation (RFC8308) is supported. The attack may also enable attackers to exploit certain implementation flaws in a man-in-the-middle (MitM) scenario.
|
golang.org/x/net 0.0.0-20210428140749-89ef3d95e781 (golang)
pkg:golang/golang.org/x/net@0.0.0-20210428140749-89ef3d95e781

| Affected range | <0.0.0-20220906165146-f3363e06e74c | | Fixed version | 0.0.0-20220906165146-f3363e06e74c | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.096% | | EPSS Percentile | 27th percentile |
Description
In net/http in Go before 1.18.6 and 1.19.x before 1.19.1, attackers can cause a denial of service because an HTTP/2 connection can hang during closing if shutdown were preempted by a fatal error.

| Affected range | <0.0.0-20211209124913-491a49abca63 | | Fixed version | 0.0.0-20211209124913-491a49abca63 | | EPSS Score | 0.114% | | EPSS Percentile | 31st percentile |
Description
An attacker can cause unbounded memory growth in servers accepting HTTP/2 requests.
Loop with Unreachable Exit Condition ('Infinite Loop')
| Affected range | <0.0.0-20210520170846-37e1c6afe023 | | Fixed version | 0.0.0-20210520170846-37e1c6afe023 | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.039% | | EPSS Percentile | 11th percentile |
Description
Go through 1.15.12 and 1.16.x through 1.16.4 has a golang.org/x/net/html infinite loop via crafted ParseFragment input.
|
golang.org/x/text 0.3.6 (golang)
pkg:golang/golang.org/x/text@0.3.6
Missing Release of Resource after Effective Lifetime
| Affected range | <0.3.8 | | Fixed version | 0.3.8 | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.054% | | EPSS Percentile | 17th percentile |
Description
The BCP 47 tag parser has quadratic time complexity due to inherent aspects of its design. Since the parser is, by design, exposed to untrusted user input, this can be leveraged to force a program to consume significant time parsing Accept-Language headers. The parser cannot be easily rewritten to fix this behavior for various reasons. Instead the solution implemented in this CL is to limit the total complexity of tags passed into ParseAcceptLanguage by limiting the number of dashes in the string to 1000. This should be more than enough for the majority of real world use cases, where the number of tags being sent is likely to be in the single digits.
Specific Go Packages Affected
golang.org/x/text/language
Out-of-bounds Read
| Affected range | <0.3.7 | | Fixed version | 0.3.7 | | CVSS Score | 7.5 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H | | EPSS Score | 0.070% | | EPSS Percentile | 22nd percentile |
Description
golang.org/x/text/language in golang.org/x/text before 0.3.7 can panic with an out-of-bounds read during BCP 47 language tag parsing. Index calculation is mishandled. If parsing untrusted user input, this can be used as a vector for a denial-of-service attack.
|
github.com/ulikunitz/xz 0.5.10 (golang)
pkg:golang/github.com/ulikunitz/xz@0.5.10
Allocation of Resources Without Limits or Throttling
| Affected range | <=0.5.13 | | Fixed version | 0.5.14 | | CVSS Score | 5.3 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L | | EPSS Score | 0.058% | | EPSS Percentile | 18th percentile |
Description
Summary
It is possible to put data in front of an LZMA-encoded byte stream without detecting the situation while reading the header. This can lead to increased memory consumption because the current implementation allocates the full decoding buffer directly after reading the header. The LZMA header doesn't include a magic number or has a checksum to detect such an issue according to the specification.
Note that the code recognizes the issue later while reading the stream, but at this time the memory allocation has already been done.
Mitigations
The release v0.5.15 includes following mitigations:
- The ReaderConfig DictCap field is now interpreted as a limit for the dictionary size.
- The default is 2 Gigabytes - 1 byte (2^31-1 bytes).
- Users can check with the [Reader.Header] method what the actual values are in their LZMA files and set a smaller limit using ReaderConfig.
- The dictionary size will not exceed the larger of the file size and the minimum dictionary size. This is another measure to prevent huge memory allocations for the dictionary.
- The code supports stream sizes only up to a pebibyte (1024^5).
Note that the original v0.5.14 version had a compiler error for 32 bit platforms, which has been fixed by v0.5.15.
Methods affected
Only software that uses lzma.NewReader or lzma.ReaderConfig.NewReader is affected. There is no issue for software using the xz functionality.
I thank @GregoryBuligin for his report, which is provided below.
Summary
When unpacking a large number of LZMA archives, even in a single goroutine, if the first byte of the archive file is 0 (a zero byte added to the beginning), an error writeMatch: distance out of range occurs. Memory consumption spikes sharply, and the GC clearly cannot handle this situation.
Details
Judging by the error writeMatch: distance out of range, the problems occur in the code around this function.
https://github.com/ulikunitz/xz/blob/c8314b8f21e9c5e25b52da07544cac14db277e89/lzma/decoderdict.go#L81
PoC
Run a function similar to this one in 1 or several goroutines on a multitude of LZMA archives that have a 0 (a zero byte) added to the beginning.
const ProjectLocalPath = "some/path" const TmpDir = "tmp"
func UnpackLZMA(lzmaFile string) error { file, err := os.Open(lzmaFile) if err != nil { return err } defer file.Close()
reader, err := lzma.NewReader(bufio.NewReader(file)) if err != nil { return err }
tmpFile, err := os.CreateTemp(TmpDir, TmpLZMAPrefix) if err != nil { return err } defer func() { tmpFile.Close() _ = os.Remove(tmpFile.Name()) }()
sha256Hasher := sha256.New() multiWriter := io.MultiWriter(tmpFile, sha256Hasher)
if _, err = io.Copy(multiWriter, reader); err != nil { return err }
unpackHash := hex.EncodeToString(sha256Hasher.Sum(nil)) unpackDir := filepath.Join( ProjectLocalPath, unpackHash[:2], ) _ = os.MkdirAll(unpackDir, DirPerm)
unpackPath := filepath.Join(unpackDir, unpackHash)
return os.Rename(tmpFile.Name(), unpackPath) }
Impact
Servers with a small amount of RAM that download and unpack a large number of unverified LZMA archives
|
golang.org/x/sys 0.0.0-20210421221651-33663a62ff08 (golang)
pkg:golang/golang.org/x/sys@0.0.0-20210421221651-33663a62ff08
Improper Privilege Management
| Affected range | <0.0.0-20220412211240-33da011f77ad | | Fixed version | 0.0.0-20220412211240-33da011f77ad | | CVSS Score | 5.3 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N | | EPSS Score | 0.173% | | EPSS Percentile | 39th percentile |
Description
Go before 1.17.10 and 1.18.x before 1.18.2 has Incorrect Privilege Reporting in syscall. When called with a non-zero flags parameter, the Faccessat function could incorrectly report that a file is accessible.
Specific Go Packages Affected
golang.org/x/sys/unix
|
golang.org/x/sys 0.0.0-20210426230700-d19ff857e887 (golang)
pkg:golang/golang.org/x/sys@0.0.0-20210426230700-d19ff857e887
Improper Privilege Management
| Affected range | <0.0.0-20220412211240-33da011f77ad | | Fixed version | 0.0.0-20220412211240-33da011f77ad | | CVSS Score | 5.3 | | CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N | | EPSS Score | 0.173% | | EPSS Percentile | 39th percentile |
Description
Go before 1.17.10 and 1.18.x before 1.18.2 has Incorrect Privilege Reporting in syscall. When called with a non-zero flags parameter, the Faccessat function could incorrectly report that a file is accessible.
Specific Go Packages Affected
golang.org/x/sys/unix
|