-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(deps): update dependency slimtoolkit/slim to v1.40.11 #2889
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-approved because label type/renovate is present.
🔍 Vulnerabilities of
|
digest | sha256:202a449dd8495b0d7d56dcef5e74ad483cf32290d3063f909ce2e655064cd4ba |
vulnerabilities | |
platform | linux/amd64 |
size | 17 MB |
packages | 122 |
stdlib
|
Affected range | <1.19.9 |
Fixed version | 1.19.9 |
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 |
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.19.10 |
Fixed version | 1.19.10 |
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.20.0 |
Fixed version | 1.20.0 |
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.10 |
Fixed version | 1.20.10 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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.19.9 |
Fixed version | 1.19.9 |
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 |
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.19.11 |
Fixed version | 1.19.11 |
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.20.8 |
Fixed version | 1.20.8 |
Description
The html/template package does not apply the proper rules for handling occurrences of "<script", "<!--", and "</script" within JS literals in <script> contexts. This may cause the template parser to improperly consider script contexts to be terminated early, causing actions to be improperly escaped. This could be leveraged to perform an XSS attack.
Affected range | <1.20.8 |
Fixed version | 1.20.8 |
Description
The html/template package does not properly handle HTML-like "" comment tokens, nor hashbang "#!" comment tokens, in <script> contexts. This may cause the template parser to improperly interpret the contents of <script> contexts, causing actions to be improperly escaped. This may be leveraged to perform an XSS attack.
Affected range | <1.20.11 |
Fixed version | 1.20.11 |
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 |
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 |
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 |
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.
github.com/antchfx/xmlquery 1.2.4
(golang)
pkg:golang/github.com/antchfx/[email protected]
Improper Restriction of Operations within the Bounds of a Memory Buffer
Affected range | <1.3.1 |
Fixed version | 1.3.1 |
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 |
Description
xmlquery before 1.3.1 lacks a check for whether a LoadURL response is in the XML format, which allows attackers to cause a denial of service (SIGSEGV) at xmlquery.(*Node).InnerText or possibly have unspecified other impact.
github.com/containerd/containerd 1.5.8
(golang)
pkg:golang/github.com/containerd/[email protected]
Improper Preservation of Permissions
Affected range | >=1.5.0 |
Fixed version | 1.5.9 |
CVSS Score | 8 |
CVSS Vector | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H |
Description
Impact
Containers launched through containerd’s CRI implementation on Linux systems which use the SELinux security module and containerd versions since v1.5.0 can cause arbitrary files and directories on the host to be relabeled to match the container process label through the use of specially-configured bind mounts in a hostPath volume. This relabeling elevates permissions for the container, granting full read/write access over the affected files and directories. Kubernetes and crictl can both be configured to use containerd’s CRI implementation.
If you are not using containerd’s CRI implementation (through one of the mechanisms described above), you are not affected by this issue.
Patches
This bug has been fixed in containerd 1.5.9. Because file labels persist independently of containerd, users should both update to these versions as soon as they are released and validate that all files on their host are correctly labeled.
Workarounds
Ensure that no sensitive files or directories are used as a hostPath volume source location. Policy enforcement mechanisms such a Kubernetes Pod Security Policy AllowedHostPaths may be specified to limit the files and directories that can be bind-mounted to containers.
For more information
If you have any questions or comments about this advisory:
- Open an issue in containerd
- Email us at [email protected]
Exposure of Sensitive Information to an Unauthorized Actor
Affected range | >=1.5.0 |
Fixed version | 1.5.10 |
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
Impact
A bug was found in containerd where containers launched through containerd’s CRI implementation with a specially-crafted image configuration could gain access to read-only copies of arbitrary files and directories on the host. This may bypass any policy-based enforcement on container setup (including a Kubernetes Pod Security Policy) and expose potentially sensitive information. Kubernetes and crictl can both be configured to use containerd’s CRI implementation.
Patches
This bug has been fixed in containerd 1.6.1, 1.5.10 and 1.4.13. Users should update to these versions to resolve the issue.
Workarounds
Ensure that only trusted images are used.
Credits
The containerd project would like to thank Felix Wilhelm of Google Project Zero for responsibly disclosing this issue in accordance with the containerd security policy.
For more information
If you have any questions or comments about this advisory:
- Open an issue in containerd
- Email us at [email protected]
Uncontrolled Resource Consumption
Affected range | <1.5.16 |
Fixed version | 1.5.16 |
CVSS Score | 5.7 |
CVSS Vector | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:N/A:H |
Description
Impact
A bug was found in containerd's CRI implementation where a user can exhaust memory on the host. In the CRI stream server, a goroutine is launched to handle terminal resize events if a TTY is requested. If the user's process fails to launch due to, for example, a faulty command, the goroutine will be stuck waiting to send without a receiver, resulting in a memory leak. Kubernetes and crictl can both be configured to use containerd's CRI implementation and the stream server is used for handling container IO.
Patches
This bug has been fixed in containerd 1.6.12 and 1.5.16. Users should update to these versions to resolve the issue.
Workarounds
Ensure that only trusted images and commands are used and that only trusted users have permissions to execute commands in running containers.
For more information
If you have any questions or comments about this advisory:
- Open an issue in containerd
- Email us at [email protected]
To report a security issue in containerd:
- Report a new vulnerability
- Email us at [email protected]
Uncontrolled Resource Consumption
Affected range | <1.5.18 |
Fixed version | 1.5.18 |
CVSS Score | 5.5 |
CVSS Vector | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
Description
Impact
When importing an OCI image, there was no limit on the number of bytes read for certain files. A maliciously crafted image with a large file where a limit was not applied could cause a denial of service.
Patches
This bug has been fixed in containerd 1.6.18 and 1.5.18. Users should update to these versions to resolve the issue.
Workarounds
Ensure that only trusted images are used and that only trusted users have permissions to import images.
Credits
The containerd project would like to thank David Korczynski and Adam Korczynski of ADA Logics for responsibly disclosing this issue in accordance with the containerd security policy during a security fuzzing audit sponsored by CNCF.
For more information
If you have any questions or comments about this advisory:
- Open an issue in containerd
- Email us at [email protected]
To report a security issue in containerd:
- Report a new vulnerability
- Email us at [email protected]
Uncontrolled Resource Consumption
Affected range | <1.5.13 |
Fixed version | 1.5.13 |
CVSS Score | 5.5 |
CVSS Vector | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Description
Impact
A bug was found in containerd's CRI implementation where programs inside a container can cause the containerd daemon to consume memory without bound during invocation of the
ExecSync
API. This can cause containerd to consume all available memory on the computer, denying service to other legitimate workloads. Kubernetes and crictl can both be configured to use containerd's CRI implementation;ExecSync
may be used when running probes or when executing processes via an "exec" facility.Patches
This bug has been fixed in containerd 1.6.6 and 1.5.13. Users should update to these versions to resolve the issue.
Workarounds
Ensure that only trusted images and commands are used.
References
- Similar fix in cri-o's CRI implementation GHSA-fcm2-6c3h-pg6j
Credits
The containerd project would like to thank David Korczynski and Adam Korczynski of ADA Logics for responsibly disclosing this issue in accordance with the containerd security policy during a security audit sponsored by CNCF and facilitated by OSTIF.
For more information
If you have any questions or comments about this advisory:
- Open an issue in containerd
- Email us at [email protected]
Affected range | <1.5.18 |
Fixed version | 1.5.18 |
CVSS Score | 5.3 |
CVSS Vector | CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L |
Description
Impact
A bug was found in containerd where supplementary groups are not set up properly inside a container. If an attacker has direct access to a container and manipulates their supplementary group access, they may be able to use supplementary group access to bypass primary group restrictions in some cases, potentially gaining access to sensitive information or gaining the ability to execute code in that container.
Downstream applications that use the containerd client library may be affected as well.
Patches
This bug has been fixed in containerd v1.6.18 and v.1.5.18. Users should update to these versions and recreate containers to resolve this issue. Users who rely on a downstream application that uses containerd's client library should check that application for a separate advisory and instructions.
Workarounds
Ensure that the
"USER $USERNAME"
Dockerfile instruction is not used. Instead, set the container entrypoint to a value similar toENTRYPOINT ["su", "-", "user"]
to allowsu
to properly set up supplementary groups.References
- https://www.benthamsgaze.org/2022/08/22/vulnerability-in-linux-containers-investigation-and-mitigation/
- Docker/Moby: CVE-2022-36109, fixed in Docker 20.10.18
- CRI-O: CVE-2022-2995, fixed in CRI-O 1.25.0
- Podman: CVE-2022-2989, fixed in Podman 3.0.1 and 4.2.0
- Buildah: CVE-2022-2990, fixed in Buildah 1.27.1
Note that CVE IDs apply to a particular implementation, even if an issue is common.
For more information
If you have any questions or comments about this advisory:
- Open an issue in containerd
- Email us at [email protected]
To report a security issue in containerd:
- Report a new vulnerability
- Email us at [email protected]
Affected range | <=1.6.25 |
Fixed version | 1.6.26 |
Description
/sys/devices/virtual/powercap accessible by default to containers
Intel's RAPL (Running Average Power Limit) feature, introduced by the Sandy Bridge microarchitecture, provides software insights into hardware energy consumption. To facilitate this, Intel introduced the powercap framework in Linux kernel 3.13, which reads values via relevant MSRs (model specific registers) and provides unprivileged userspace access via
sysfs
. As RAPL is an interface to access a hardware feature, it is only available when running on bare metal with the module compiled into the kernel.By 2019, it was realized that in some cases unprivileged access to RAPL readings could be exploited as a power-based side-channel against security features including AES-NI (potentially inside a SGX enclave) and KASLR (kernel address space layout randomization). Also known as the PLATYPUS attack, Intel assigned CVE-2020-8694 and CVE-2020-8695, and AMD assigned CVE-2020-12912.
Several mitigations were applied; Intel reduced the sampling resolution via a microcode update, and the Linux kernel prevents access by non-root users since 5.10. However, this kernel-based mitigation does not apply to many container-based scenarios:
- Unless using user namespaces, root inside a container has the same level of privilege as root outside the container, but with a slightly more narrow view of the system
sysfs
is mounted inside containers read-only; however only read access is needed to carry out this attack on an unpatched CPUWhile this is not a direct vulnerability in container runtimes, defense in depth and safe defaults are valuable and preferred, especially as this poses a risk to multi-tenant container environments. This is provided by masking
/sys/devices/virtual/powercap
in the default mount configuration, and adding an additional set of rules to deny it in the default AppArmor profile.While
sysfs
is not the only way to read from the RAPL subsystem, other ways of accessing it require additional capabilities such asCAP_SYS_RAWIO
which is not available to containers by default, orperf
paranoia level less than 1, which is a non-default kernel tunable.References
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8694
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8695
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12912
- https://platypusattack.com/
- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=949dd0104c496fa7c14991a23c03c62e44637e71
- https://web.eece.maine.edu/~vweaver/projects/rapl/
OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
Affected range | <=1.6.25 |
Fixed version | 1.6.26, 1.7.11 |
Description
/sys/devices/virtual/powercap accessible by default to containers
Intel's RAPL (Running Average Power Limit) feature, introduced by the Sandy Bridge microarchitecture, provides software insights into hardware energy consumption. To facilitate this, Intel introduced the powercap framework in Linux kernel 3.13, which reads values via relevant MSRs (model specific registers) and provides unprivileged userspace access via
sysfs
. As RAPL is an interface to access a hardware feature, it is only available when running on bare metal with the module compiled into the kernel.By 2019, it was realized that in some cases unprivileged access to RAPL readings could be exploited as a power-based side-channel against security features including AES-NI (potentially inside a SGX enclave) and KASLR (kernel address space layout randomization). Also known as the PLATYPUS attack, Intel assigned CVE-2020-8694 and CVE-2020-8695, and AMD assigned CVE-2020-12912.
Several mitigations were applied; Intel reduced the sampling resolution via a microcode update, and the Linux kernel prevents access by non-root users since 5.10. However, this kernel-based mitigation does not apply to many container-based scenarios:
- Unless using user namespaces, root inside a container has the same level of privilege as root outside the container, but with a slightly more narrow view of the system
sysfs
is mounted inside containers read-only; however only read access is needed to carry out this attack on an unpatched CPUWhile this is not a direct vulnerability in container runtimes, defense in depth and safe defaults are valuable and preferred, especially as this poses a risk to multi-tenant container environments. This is provided by masking
/sys/devices/virtual/powercap
in the default mount configuration, and adding an additional set of rules to deny it in the default AppArmor profile.While
sysfs
is not the only way to read from the RAPL subsystem, other ways of accessing it require additional capabilities such asCAP_SYS_RAWIO
which is not available to containers by default, orperf
paranoia level less than 1, which is a non-default kernel tunable.References
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8694
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8695
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12912
- https://platypusattack.com/
- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=949dd0104c496fa7c14991a23c03c62e44637e71
- https://web.eece.maine.edu/~vweaver/projects/rapl/
github.com/opencontainers/runc 1.0.2
(golang)
pkg:golang/github.com/opencontainers/[email protected]
Exposure of File Descriptor to Unintended Control Sphere ('File Descriptor Leak')
Affected range | >=1.0.0-rc93 |
Fixed version | 1.1.12 |
CVSS Score | 8.6 |
CVSS Vector | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H |
Description
Impact
In runc 1.1.11 and earlier, due to an internal file descriptor leak, an attacker could cause a newly-spawned container process (from
runc exec
) to have a working directory in the host filesystem namespace, allowing for a container escape by giving access to the host filesystem ("attack 2"). The same attack could be used by a malicious image to allow a container process to gain access to the host filesystem throughrunc run
("attack 1"). Variants of attacks 1 and 2 could be also be used to overwrite semi-arbitrary host binaries, allowing for complete container escapes ("attack 3a" and "attack 3b").Strictly speaking, while attack 3a is the most severe from a CVSS perspective, attacks 2 and 3b are arguably more dangerous in practice because they allow for a breakout from inside a container as opposed to requiring a user execute a malicious image. The reason attacks 1 and 3a are scored higher is because being able to socially engineer users is treated as a given for UI:R vectors, despite attacks 2 and 3b requiring far more minimal user interaction (just reasonable
runc exec
operations on a container the attacker has access to). In any case, all four attacks can lead to full control of the host system.Attack 1:
process.cwd
"mis-configuration"In runc 1.1.11 and earlier, several file descriptors were inadvertently leaked internally within runc into
runc init
, including a handle to the host's/sys/fs/cgroup
(this leak was added in v1.0.0-rc93). If the container was configured to haveprocess.cwd
set to/proc/self/fd/7/
(the actual fd can change depending on file opening order inrunc
), the resulting pid1 process will have a working directory in the host mount namespace and thus the spawned process can access the entire host filesystem. This alone is not an exploit against runc, however a malicious image could make any innocuous-looking non-/
path a symlink to/proc/self/fd/7/
and thus trick a user into starting a container whose binary has access to the host filesystem.Furthermore, prior to runc 1.1.12, runc also did not verify that the final working directory was inside the container's mount namespace after calling
chdir(2)
(as we have already joined the container namespace, it was incorrectly assumed there would be no way to chdir outside the container afterpivot_root(2)
).The CVSS score for this attack is CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N (8.2, high severity).
Note that this attack requires a privileged user to be tricked into running a malicious container image. It should be noted that when using higher-level runtimes (such as Docker or Kubernetes), this exploit can be considered critical as it can be done remotely by anyone with the rights to start a container image (and can be exploited from within Dockerfiles using
ONBUILD
in the case of Docker).Attack 2:
runc exec
container breakout(This is a modification of attack 1, constructed to allow for a process inside a container to break out.)
The same fd leak and lack of verification of the working directory in attack 1 also apply to
runc exec
. If a malicious process inside the container knows that some administrative process will callrunc exec
with the--cwd
argument and a given path, in most cases they can replace that path with a symlink to/proc/self/fd/7/
. Once the container process has executed the container binary,PR_SET_DUMPABLE
protections no longer apply and the attacker can open/proc/$exec_pid/cwd
to get access to the host filesystem.
runc exec
defaults to a cwd of/
(which cannot be replaced with a symlink), so this attack depends on the attacker getting a user (or some administrative process) to use--cwd
and figuring out what path the target working directory is. Note that if the target working directory is a parent of the program binary being executed, the attacker might be unable to replace the path with a symlink (theexecve
will fail in most cases, unless the host filesystem layout specifically matches the container layout in specific ways and the attacker knows which binary therunc exec
is executing).The CVSS score for this attack is CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N (7.2, high severity).
Attacks 3a and 3b:
process.args
host binary overwrite attack(These are modifications of attacks 1 and 2, constructed to overwrite a host binary by using
execve
to bring a magic-link reference into the container.)Attacks 1 and 2 can be adapted to overwrite a host binary by using a path like
/proc/self/fd/7/../../../bin/bash
as theprocess.args
binary argument, causing a host binary to be executed by a container process. The/proc/$pid/exe
handle can then be used to overwrite the host binary, as seen in CVE-2019-5736 (note that the same#!
trick can be used to avoid detection as an attacker). As the overwritten binary could be something like/bin/bash
, as soon as a privileged user executes the target binary on the host, the attacker can pivot to gain full access to the host.For the purposes of CVSS scoring:
- Attack 3a is attack 1 but adapted to overwrite a host binary, where a malicious image is set up to execute
/proc/self/fd/7/../../../bin/bash
and run a shell script that overwrites/proc/self/exe
, overwriting the host copy of/bin/bash
. The CVSS score for this attack is CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H (8.6, high severity).- Attack 3b is attack 2 but adapted to overwrite a host binary, where the malicious container process overwrites all of the possible
runc exec
target binaries inside the container (such as/bin/bash
) such that a host target binary is executed and then the container process opens/proc/$pid/exe
to get access to the host binary and overwrite it. The CVSS score for this attack is CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H (8.2, high severity).As mentioned in attack 1, while 3b is scored lower it is more dangerous in practice as it doesn't require a user to run a malicious image.
Patches
runc 1.1.12 has been released, and includes patches for this issue. Note that there are four separate fixes applied:
- Checking that the working directory is actually inside the container by checking whether
os.Getwd
returnsENOENT
(Linux provides a way of detecting if cwd is outside the current namespace root). This explicitly blocks runc from executing a container process when inside a non-container path and thus eliminates attacks 1 and 2 even in the case of fd leaks.- Close all internal runc file descriptors in the final stage of
runc init
, right beforeexecve
. This ensures that internal file descriptors cannot be used as an argument toexecve
and thus eliminates attacks 3a and 3b, even in the case of fd leaks. This requires hooking into some Go runtime internals to make sure we don't close critical Go internal file descriptors.- Fixing the specific fd leaks that made these bug exploitable (mark
/sys/fs/cgroup
asO_CLOEXEC
and backport a fix for some*os.File
leaks).- In order to protect against future
runc init
file descriptor leaks, mark all non-stdio files asO_CLOEXEC
before executingrunc init
.Other Runtimes
We have discovered that several other container runtimes are either potentially vulnerable to similar attacks, or do not have sufficient protection against attacks of this nature. We recommend other container runtime authors look at our patches and make sure they at least add a
getcwd() != ENOENT
check as well as consider whetherclose_range(3, UINT_MAX, CLOSE_RANGE_CLOEXEC)
before executing their equivalent ofrunc init
is appropriate.
- crun 1.12 does not leak any useful file descriptors into the
runc init
-equivalent process (so this attack is not exploitable as far as we can tell), but no care is taken to make sure all non-stdio files areO_CLOEXEC
and there is no check afterchdir(2)
to ensure the working directory is inside the container. If a file descriptor happened to be leaked in the future, this could be exploitable. In addition, any file descriptors passed tocrun
are not closed until the container process is executed, meaning that easily-overlooked programming errors by users ofcrun
can lead to these attacks becoming exploitable.- youki 0.3.1 does not leak any useful file descriptors into the
runc init
-equivalent process (so this attack is not exploitable as far as we can tell) however this appears to be pure luck.youki
does leak a directory file descriptor from the host mount namespace, but it just so happens that the directory is the rootfs of the container (which then getspivot_root
'd into and so ends up as a in-root path thanks tochroot_fs_refs
). In addition, no care is taken to make sure all non-stdio files areO_CLOEXEC
and there is no check afterchdir(2)
to ensure the working directory is inside the container. If a file descriptor happened to be leaked in the future, this could be exploitable. In addition, any file descriptors passed toyouki
are not closed until the container process is executed, meaning that easily-overlooked programming errors by users ofyouki
can lead to these attacks becoming exploitable.- LXC 5.0.3 does not appear to leak any useful file descriptors, and they have comments noting the importance of not leaking file descriptors in
lxc-attach
. However, they don't seem to have any proactive protection against file descriptor leaks at the point ofchdir
such as usingclose_range(...)
(they do have RAII-like__do_fclose
closers but those don't necessarily stop all leaks in this context) nor do they have any check afterchdir(2)
to ensure the working directory is inside the container. Unfortunately it seems they cannot useCLOSE_RANGE_CLOEXEC
because they don't need to re-exec themselves.Workarounds
For attacks 1 and 2, only permit containers (and
runc exec
) to use aprocess.cwd
of/
. It is not possible for/
to be replaced with a symlink (the path is resolved from within the container's mount namespace, and you cannot change the root of a mount namespace or an fs root to a symlink).For attacks 1 and 3a, only permit users to run trusted images.
For attack 3b, there is no practical workaround other than never using
runc exec
because any binary you try to execute withrunc exec
could end up being a malicious binary target.References
- https://www.cve.org/CVERecord?id=CVE-2024-21626
- https://github.com/opencontainers/runc/releases/tag/v1.1.12
- opencontainers/runc@7362cd5
- opencontainers/runc@2ed79a6
- opencontainers/runc@b2b5754
- opencontainers/runc@996a33c
- opencontainers/runc@f3429ed
- opencontainers/runc@4f26398
Credits
Thanks to Rory McNamara from Snyk for discovering and disclosing the original vulnerability (attack 1) to Docker, @lifubang from acmcoder for discovering how to adapt the attack to overwrite host binaries (attack 3a), and Aleksa Sarai from SUSE for discovering how to adapt the attacks to work as container breakouts using
runc exec
(attacks 2 and 3b).
Use of Incorrectly-Resolved Name or Reference
Affected range | >=1.0.0-rc95 |
Fixed version | 1.1.5 |
CVSS Score | 7 |
CVSS Vector | CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H |
Description
runc 1.0.0-rc95 through 1.1.4 has Incorrect Access Control leading to Escalation of Privileges, related to
libcontainer/rootfs_linux.go
. To exploit this, an attacker must be able to spawn two containers with custom volume-mount configurations, and be able to run custom images. NOTE: this issue exists because of a CVE-2019-19921 regression.
Improper Preservation of Permissions
Affected range | <1.1.5 |
Fixed version | 1.1.5 |
CVSS Score | 6.1 |
CVSS Vector | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L |
Description
Impact
It was found that AppArmor, and potentially SELinux, can be bypassed when
/proc
inside the container is symlinked with a specific mount configuration.Patches
Fixed in runc v1.1.5, by prohibiting symlinked
/proc
: opencontainers/runc#3785This PR fixes CVE-2023-27561 as well.
Workarounds
Avoid using an untrusted container image.
Integer Overflow or Wraparound
Affected range | <1.0.3 |
Fixed version | 1.0.3 |
CVSS Score | 6 |
CVSS Vector | CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:L |
Description
Impact
In runc, netlink is used internally as a serialization system for specifying the relevant container configuration to the C portion of our code (responsible for the based namespace setup of containers). In all versions of runc prior to 1.0.3, the encoder did not handle the possibility of an integer overflow in the 16-bit length field for the byte array attribute type, meaning that a large enough malicious byte array attribute could result in the length overflowing and the attribute contents being parsed as netlink messages for container configuration.
This vulnerability requires the attacker to have some control over the configuration of the container and would allow the attacker to bypass the namespace restrictions of the container by simply adding their own netlink payload which disables all namespaces.
Prior to 9c444070ec7bb83995dbc0185da68284da71c554, in practice it was fairly difficult to specify an arbitrary-length netlink message with most container runtimes. The only user-controlled byte array was the namespace paths attributes which can be specified in runc's
config.json
, but as far as we can tell no container runtime gives raw access to that configuration setting -- and having raw access to that setting would allow the attacker to disable namespace protections entirely anyway (setting them to/proc/1/ns/...
for instance). In addition, each namespace path is limited to 4096 bytes (with only 7 namespaces supported by runc at the moment) meaning that even with custom namespace paths it appears an attacker still cannot shove enough bytes into the netlink bytemsg in order to overflow the uint16 counter.However, out of an abundance of caution (given how old this bug is) we decided to treat it as a potentially exploitable vulnerability with a low severity. After 9c444070ec7bb83995dbc0185da68284da71c554 (which was not present in any release of runc prior to the discovery of this bug), all mount paths are included as a giant netlink message which means that this bug becomes significantly more exploitable in more reasonable threat scenarios.
The main users impacted are those who allow untrusted images with untrusted configurations to run on their machines (such as with shared cloud infrastructure), though as mentioned above it appears this bug was not practically exploitable on any released version of runc to date.
Patches
The patch for this is d72d057ba794164c3cce9451a00b72a78b25e1ae and runc 1.0.3 was released with this bug fixed.
Workarounds
To the extent this is exploitable, disallowing untrusted namespace paths in container configuration should eliminate all practical ways of exploiting this bug. It should be noted that untrusted namespace paths would allow the attacker to disable namespace protections entirely even in the absence of this bug.
References
- commit d72d057ba794 ("runc init: avoid netlink message length overflows")
- https://bugs.chromium.org/p/project-zero/issues/detail?id=2241
Credits
Thanks to Felix Wilhelm from Google Project Zero for discovering and reporting this vulnerability. In particular, the fact they found this vulnerability so quickly, before we made a 1.1 release of runc (which would've been vulnerable) was quite impressive.
For more information
If you have any questions or comments about this advisory:
- Open an issue in our repo
Affected range | <1.1.2 |
Fixed version | 1.1.2 |
CVSS Score | 5.9 |
CVSS Vector | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L |
Description
Impact
A bug was found in runc where
runc exec --cap
executed processes with non-empty inheritable Linux process capabilities, creating an atypical Linux environment and enabling programs with inheritable file capabilities to elevate those capabilities to the permitted set during execve(2).This bug did not affect the container security sandbox as the inheritable set never contained more capabilities than were included in the container's bounding set.
Patches
This bug has been fixed in runc 1.1.2. Users should update to this version as soon as possible.
This fix changes
runc exec --cap
behavior such that the additional capabilities granted to the process being executed (as specified via--cap
arguments) do not include inheritable capabilities.In addition,
runc spec
is changed to not set any inheritable capabilities in the created example OCI spec (config.json
) file.Credits
The opencontainers project would like to thank Andrew G. Morgan for responsibly disclosing this issue in accordance with the opencontainers org security policy.
For more information
If you have any questions or comments about this advisory:
- Open an issue
- Email us at [email protected] if you think you’ve found a security bug
Improper Preservation of Permissions
Affected range | <1.1.5 |
Fixed version | 1.1.5 |
CVSS Score | 2.5 |
CVSS Vector | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:C/C:N/I:N/A:L |
Description
Impact
It was found that rootless runc makes
/sys/fs/cgroup
writable in following conditons:
- when runc is executed inside the user namespace, and the
config.json
does not specify the cgroup namespace to be unshared (e.g..,(docker|podman|nerdctl) run --cgroupns=host
, with Rootless Docker/Podman/nerdctl)- or, when runc is executed outside the user namespace, and
/sys
is mounted withrbind, ro
(e.g.,runc spec --rootless
; this condition is very rare)A container may gain the write access to user-owned cgroup hierarchy
/sys/fs/cgroup/user.slice/...
on the host .
Other users's cgroup hierarchies are not affected.Patches
v1.1.5 (planned)
Workarounds
- Condition 1: Unshare the cgroup namespace (
(docker|podman|nerdctl) run --cgroupns=private)
. This is the default behavior of Docker/Podman/nerdctl on cgroup v2 hosts.- Condition 2 (very rare): add
/sys/fs/cgroup
tomaskedPaths
github.com/ulikunitz/xz 0.5.7
(golang)
pkg:golang/github.com/ulikunitz/[email protected]
Loop with Unreachable Exit Condition ('Infinite Loop')
Affected range | <0.5.8 |
Fixed version | 0.5.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 |
Description
Impact
xz is a compression and decompression library focusing on the xz format completely written in Go. The function readUvarint used to read the xz container format may not terminate a loop provide malicous input.
Patches
The problem has been fixed in release v0.5.8.
Workarounds
Limit the size of the compressed file input to a reasonable size for your use case.
References
The standard library had recently the same issue and got the CVE-2020-16845 allocated.
For more information
If you have any questions or comments about this advisory:
- Open an issue in xz.
Loop with Unreachable Exit Condition ('Infinite Loop')
Affected range | <0.5.8 |
Fixed version | 0.5.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 |
Description
Go before 1.13.15 and 14.x before 1.14.7 can have an infinite read loop in ReadUvarint and ReadVarint in encoding/binary via invalid inputs.
github.com/docker/docker 20.10.12+incompatible
(golang)
pkg:golang/github.com/docker/[email protected]+incompatible
Unprotected Alternate Channel
Affected range | >=1.12.0 |
Fixed version | 20.10.24 |
CVSS Score | 7.5 |
CVSS Vector | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:L |
Description
Moby is an open source container framework developed by Docker Inc. that is distributed as Docker, Mirantis Container Runtime, and various other downstream projects/products. The Moby daemon component (
dockerd
), which is developed as moby/moby is commonly referred to as Docker.Swarm Mode, which is compiled in and delivered by default in
dockerd
and is thus present in most major Moby downstreams, is a simple, built-in container orchestrator that is implemented through a combination of SwarmKit and supporting network code.The
overlay
network driver is a core feature of Swarm Mode, providing isolated virtual LANs that allow communication between containers and services across the cluster. This driver is an implementation/user of VXLAN, which encapsulates link-layer (Ethernet) frames in UDP datagrams that tag the frame with a VXLAN Network ID (VNI) that identifies the originating overlay network. In addition, the overlay network driver supports an optional, off-by-default encrypted mode, which is especially useful when VXLAN packets traverses an untrusted network between nodes.Encrypted overlay networks function by encapsulating the VXLAN datagrams through the use of the IPsec Encapsulating Security Payload protocol in Transport mode. By deploying IPSec encapsulation, encrypted overlay networks gain the additional properties of source authentication through cryptographic proof, data integrity through check-summing, and confidentiality through encryption.
When setting an endpoint up on an encrypted overlay network, Moby installs three iptables (Linux kernel firewall) rules that enforce both incoming and outgoing IPSec. These rules rely on the
u32
iptables extension provided by thext_u32
kernel module to directly filter on a VXLAN packet's VNI field, so that IPSec guarantees can be enforced on encrypted overlay networks without interfering with other overlay networks or other users of VXLAN.Two iptables rules serve to filter incoming VXLAN datagrams with a VNI that corresponds to an encrypted network and discards unencrypted datagrams. The rules are appended to the end of the
INPUT
filter chain, following any rules that have been previously set by the system administrator. Administrator-set rules take precedence over the rules Moby sets to discard unencrypted VXLAN datagrams, which can potentially admit unencrypted datagrams that should have been discarded.On Red Hat Enterprise Linux and derivatives such as CentOS and Rocky, the
xt_u32
module has been:
- moved to the kernel-modules-extra package and no longer installed by default in RHEL 8.3
- officially deprecated in RHEL 8.6
- removed completely in RHEL 9
These rules are not created when
xt_u32
is unavailable, even though the container is still attached to the network.Impact
Encrypted overlay networks on affected configurations silently accept cleartext VXLAN datagrams that are tagged with the VNI of an encrypted overlay network. As a result, it is possible to inject arbitrary Ethernet frames into the encrypted overlay network by encapsulating them in VXLAN datagrams.
The injection of arbitrary Ethernet frames can enable a Denial of Service attack. A sophisticated attacker may be able to establish a UDP or TCP connection by way of the container’s outbound gateway that would otherwise be blocked by a stateful firewall, or carry out other escalations beyond simple injection by smuggling packets into the overlay network.
Patches
Patches are available in Moby releases 23.0.3, and 20.10.24. As Mirantis Container Runtime's 20.10 releases are numbered differently, users of that platform should update to 20.10.16.
Workarounds
- Close the VXLAN port (by default, UDP port 4789) to incoming traffic at the Internet boundary (see GHSA-vwm3-crmr-xfxw) to prevent all VXLAN packet injection.
- Ensure that the
xt_u32
kernel module is available on all nodes of the Swarm cluster.Background
- #43382 partially discussed this concern, but did not consider the security implications.
- Mirantis FIELD-5788 essentially duplicates #43382, and was created six months earlier; it similarly overlooked the security implications.
- #45118 is the ancestor of the final patches, and was where the security implications were discovered.
Related
- CVE-2023-28841: Encrypted overlay network traffic may be unencrypted
- CVE-2023-28842: Encrypted overlay network with a single endpoint is unauthenticated
- GHSA-vwm3-crmr-xfxw: The Swarm VXLAN port may be exposed to attack due to ambiguous documentation
- GHSA-gvm4-2qqg-m333: Security issues in encrypted overlay networks (libnetwork)
Affected range | >=1.12.0 |
Fixed version | 20.10.24 |
CVSS Score | 6.8 |
CVSS Vector | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N |
Description
Moby is an open source container framework developed by Docker Inc. that is distributed as Docker, Mirantis Container Runtime, and various other downstream projects/products. The Moby daemon component (
dockerd
), which is developed as moby/moby is commonly referred to as Docker.Swarm Mode, which is compiled in and delivered by default in
dockerd
and is thus present in most major Moby downstreams, is a simple, built-in container orchestrator that is implemented through a combination of SwarmKit and supporting network code.The
overlay
network driver is a core feature of Swarm Mode, providing isolated virtual LANs that allow communication between containers and services across the cluster. This driver is an implementation/user of VXLAN, which encapsulates link-layer (Ethernet) frames in UDP datagrams that tag the frame with a VXLAN Network ID (VNI) that identifies the originating overlay network. In addition, the overlay network driver supports an optional, off-by-default encrypted mode, which is especially useful when VXLAN packets traverses an untrusted network between nodes.Encrypted overlay networks function by encapsulating the VXLAN datagrams through the use of the IPsec Encapsulating Security Payload protocol in Transport mode. By deploying IPSec encapsulation, encrypted overlay networks gain the additional properties of source authentication through cryptographic proof, data integrity through check-summing, and confidentiality through encryption.
When setting an endpoint up on an encrypted overlay network, Moby installs three iptables (Linux kernel firewall) rules that enforce both incoming and outgoing IPSec. These rules rely on the
u32
iptables extension provided by thext_u32
kernel module to directly filter on a VXLAN packet's VNI field, so that IPSec guarantees can be enforced on encrypted overlay networks without interfering with other overlay networks or other users of VXLAN.The
overlay
driver dynamically and lazily defines the kernel configuration for the VXLAN network on each node as containers are attached and detached. Routes and encryption parameters are only defined for destination nodes that participate in the network. The iptables rules that prevent encrypted overlay networks from accepting unencrypted packets are not created until a peer is available with which to communicate.Impact
Encrypted overlay networks silently accept cleartext VXLAN datagrams that are tagged with the VNI of an encrypted overlay network. As a result, it is possible to inject arbitrary Ethernet frames into the encrypted overlay network by encapsulating them in VXLAN datagrams. The implications of this can be quite dire, and GHSA-vwm3-crmr-xfxw should be referenced for a deeper exploration.
Patches
Patches are available in Moby releases 23.0.3, and 20.10.24. As Mirantis Container Runtime's 20.10 releases are numbered differently, users of that platform should update to 20.10.16.
Workarounds
- In multi-node clusters, deploy a global ‘pause’ container for each encrypted overlay network, on every node. For example, use the
registry.k8s.io/pause
image and a--mode global
service.- For a single-node cluster, do not use overlay networks of any sort. Bridge networks provide the same connectivity on a single node and have no multi-node features.
The Swarm ingress feature is implemented using an overlay network, but can be disabled by publishing ports inhost
mode instead ofingress
mode (allowing the use of an external load balancer), and removing theingress
network.- If encrypted overlay networks are in exclusive use, block UDP port 4789 from traffic that has not been validated by IPSec. For example,
iptables -A INPUT -m udp —-dport 4789 -m policy --dir in --pol none -j DROP
.Background
- This issue was discovered while characterizing and mitigating CVE-2023-28840 and CVE-2023-28841.
Related
- CVE-2023-28841: Encrypted overlay network traffic may be unencrypted
- CVE-2023-28840: Encrypted overlay network may be unauthenticated
- GHSA-vwm3-crmr-xfxw: The Swarm VXLAN port may be exposed to attack due to ambiguous documentation
- GHSA-gvm4-2qqg-m333: Security issues in encrypted overlay networks (libnetwork)
Missing Encryption of Sensitive Data
Affected range | >=1.12.0 |
Fixed version | 20.10.24 |
CVSS Score | 6.8 |
CVSS Vector | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N |
Description
Moby is an open source container framework developed by Docker Inc. that is distributed as Docker, Mirantis Container Runtime, and various other downstream projects/products. The Moby daemon component (
dockerd
), which is developed as moby/moby is commonly referred to as Docker.Swarm Mode, which is compiled in and delivered by default in
dockerd
and is thus present in most major Moby downstreams, is a simple, built-in container orchestrator that is implemented through a combination of SwarmKit and supporting network code.The
overlay
network driver is a core feature of Swarm Mode, providing isolated virtual LANs that allow communication between containers and services across the cluster. This driver is an implementation/user of VXLAN, which encapsulates link-layer (Ethernet) frames in UDP datagrams that tag the frame with a VXLAN Network ID (VNI) that identifies the originating overlay network. In addition, the overlay network driver supports an optional, off-by-default encrypted mode, which is especially useful when VXLAN packets traverses an untrusted network between nodes.Encrypted overlay networks function by encapsulating the VXLAN datagrams through the use of the IPsec Encapsulating Security Payload protocol in Transport mode. By deploying IPSec encapsulation, encrypted overlay networks gain the additional properties of source authentication through cryptographic proof, data integrity through check-summing, and confidentiality through encryption.
When setting an endpoint up on an encrypted overlay network, Moby installs three iptables (Linux kernel firewall) rules that enforce both incoming and outgoing IPSec. These rules rely on the
u32
iptables extension provided by thext_u32
kernel module to directly filter on a VXLAN packet's VNI field, so that IPSec guarantees can be enforced on encrypted overlay networks without interfering with other overlay networks or other users of VXLAN.An iptables rule designates outgoing VXLAN datagrams with a VNI that corresponds to an encrypted overlay network for IPsec encapsulation.
On Red Hat Enterprise Linux and derivatives such as CentOS and Rocky, the
xt_u32
module has been:
- moved to the kernel-modules-extra package and no longer installed by default in RHEL 8.3
- officially deprecated in RHEL 8.6
- removed completely in RHEL 9
This rule is not created when
xt_u32
is unavailable, even though the container is still attached to the network.Impact
Encrypted overlay networks on affected platforms silently transmit unencrypted data. As a result,
overlay
networks may appear to be functional, passing traffic as expected, but without any of the expected confidentiality or data integrity guarantees.It is possible for an attacker sitting in a trusted position on the network to read all of the application traffic that is moving across the overlay network, resulting in unexpected secrets or user data disclosure. Thus, because many database protocols, internal APIs, etc. are not protected by a second layer of encryption, a user may rely on Swarm encrypted overlay networks to provide confidentiality, which due to this vulnerability is no longer guaranteed.
Patches
Patches are available in Moby releases 23.0.3, and 20.10.24. As Mirantis Container Runtime's 20.10 releases are numbered differently, users of that platform should update to 20.10.16.
Workarounds
- Close the VXLAN port (by default, UDP port 4789) to outgoing traffic at the Internet boundary (see GHSA-vwm3-crmr-xfxw) in order to prevent unintentionally leaking unencrypted traffic over the Internet.
- Ensure that the
xt_u32
kernel module is available on all nodes of the Swarm cluster.Background
- #43382 partially discussed this concern, but did not consider the security implications.
- Mirantis FIELD-5788 essentially duplicates #43382, and was created six months earlier; it similarly overlooked the security implications.
- #45118 is the ancestor of the final patches, and was where the security implications were discovered.
Related
- CVE-2023-28840: Encrypted overlay network may be unauthenticated
- CVE-2023-28842: Encrypted overlay network with a single endpoint is unauthenticated
- GHSA-vwm3-crmr-xfxw: The Swarm VXLAN port may be exposed to attack due to ambiguous documentation
- GHSA-gvm4-2qqg-m333: Security issues in encrypted overlay networks (libnetwork)
Affected range | <20.10.27 |
Fixed version | 24.0.7 |
Description
Intel's RAPL (Running Average Power Limit) feature, introduced by the Sandy Bridge microarchitecture, provides software insights into hardware energy consumption. To facilitate this, Intel introduced the powercap framework in Linux kernel 3.13, which reads values via relevant MSRs (model specific registers) and provides unprivileged userspace access via
sysfs
. As RAPL is an interface to access a hardware feature, it is only available when running on bare metal with the module compiled into the kernel.By 2019, it was realized that in some cases unprivileged access to RAPL readings could be exploited as a power-based side-channel against security features including AES-NI (potentially inside a SGX enclave) and KASLR (kernel address space layout randomization). Also known as the PLATYPUS attack, Intel assigned CVE-2020-8694 and CVE-2020-8695, and AMD assigned CVE-2020-12912.
Several mitigations were applied; Intel reduced the sampling resolution via a microcode update, and the Linux kernel prevents access by non-root users since 5.10. However, this kernel-based mitigation does not apply to many container-based scenarios:
- Unless using user namespaces, root inside a container has the same level of privilege as root outside the container, but with a slightly more narrow view of the system
sysfs
is mounted inside containers read-only; however only read access is needed to carry out this attack on an unpatched CPUWhile this is not a direct vulnerability in container runtimes, defense in depth and safe defaults are valuable and preferred, especially as this poses a risk to multi-tenant container environments running directly on affected hardware. This is provided by masking
/sys/devices/virtual/powercap
in the default mount configuration, and adding an additional set of rules to deny it in the default AppArmor profile.While
sysfs
is not the only way to read from the RAPL subsystem, other ways of accessing it require additional capabilities such asCAP_SYS_RAWIO
which is not available to containers by default, orperf
paranoia level less than 1, which is a non-default kernel tunable.References
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8694
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-8695
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12912
- https://platypusattack.com/
- https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=949dd0104c496fa7c14991a23c03c62e44637e71
- https://web.eece.maine.edu/~vweaver/projects/rapl/
OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
Affected range | <20.10.27 |
Fixed version | v24.0.7 |
Description
Intel's RAPL (Running Average Power Limit) feature, introduced by the Sandy Bridge microarchitecture, provides software insights into hardware energy consumption. To facilitate this, Intel introduced the powercap framework in Linux kernel 3.13, which reads values via relevant MSRs (model specific registers) and provides unprivileged userspace access via
sysfs
.
google.golang.org/grpc 1.43.0
(golang)
pkg:golang/google.golang.org/[email protected]
Affected range | <1.56.3 |
Fixed version | 1.56.3 |
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
Impact
In affected releases of gRPC-Go, it is possible for an attacker to send HTTP/2 requests, cancel them, and send subsequent requests, which is valid by the HTTP/2 protocol, but would cause the gRPC-Go server to launch more concurrent method handlers than the configured maximum stream limit.
Patches
This vulnerability was addressed by #6703 and has been included in patch releases: 1.56.3, 1.57.1, 1.58.3. It is also included in the latest release, 1.59.0.
Along with applying the patch, users should also ensure they are using the
grpc.MaxConcurrentStreams
server option to apply a limit to the server's resources used for any single connection.Workarounds
None.
References
Uncontrolled Resource Consumption
Affected range | <1.56.3 |
Fixed version | 1.56.3 |
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 |
Description
HTTP/2 Rapid reset attack
The HTTP/2 protocol allows clients to indicate to the server that a previous stream should be canceled by sending a RST_STREAM frame. The protocol does not require the client and server to coordinate the cancellation in any way, the client may do it unilaterally. The client may also assume that the cancellation will take effect immediately when the server receives the RST_STREAM frame, before any other data from that TCP connection is processed.
Abuse of this feature is called a Rapid Reset attack because it relies on the ability for an endpoint to send a RST_STREAM frame immediately after sending a request frame, which makes the other endpoint start working and then rapidly resets the request. The request is canceled, but leaves the HTTP/2 connection open.
The HTTP/2 Rapid Reset attack built on this capability is simple: The client opens a large number of streams at once as in the standard HTTP/2 attack, but rather than waiting for a response to each request stream from the server or proxy, the client cancels each request immediately.
The ability to reset streams immediately allows each connection to have an indefinite number of requests in flight. By explicitly canceling the requests, the attacker never exceeds the limit on the number of concurrent open streams. The number of in-flight requests is no longer dependent on the round-trip time (RTT), but only on the available network bandwidth.
In a typical HTTP/2 server implementation, the server will still have to do significant amounts of work for canceled requests, such as allocating new stream data structures, parsing the query and doing header decompression, and mapping the URL to a resource. For reverse proxy implementations, the request may be proxied to the backend server before the RST_STREAM frame is processed. The client on the other hand paid almost no costs for sending the requests. This creates an exploitable cost asymmetry between the server and the client.
Multiple software artifacts implementing HTTP/2 are affected. This advisory was originally ingested from the
swift-nio-http2
repo advisory and their original conent follows.swift-nio-http2 specific advisory
swift-nio-http2 is vulnerable to a denial-of-service vulnerability in which a malicious client can create and then reset a large number of HTTP/2 streams in a short period of time. This causes swift-nio-http2 to commit to a large amount of expensive work which it then throws away, including creating entirely new
Channel
s to serve the traffic. This can easily overwhelm anEventLoop
and prevent it from making forward progress.swift-nio-http2 1.28 contains a remediation for this issue that applies reset counter using a sliding window. This constrains the number of stream resets that may occur in a given window of time. Clients violating this limit will have their connections torn down. This allows clients to continue to cancel streams for legitimate reasons, while constraining malicious actors.
OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
Affected range | <1.56.3 |
Fixed version | 1.56.3, 1.57.1, 1.58.3 |
Description
Impact
In affected releases of gRPC-Go, it is possible for an attacker to send HTTP/2 requests, cancel them, and send subsequent requests, which is valid by the HTTP/2 protocol, but would cause the gRPC-Go server to launch more concurrent method handlers than the configured maximum stream limit.
Patches
This vulnerability was addressed by #6703 and has been included in patch releases: 1.56.3, 1.57.1, 1.58.3. It is also included in the latest release, 1.59.0.
Along with applying the patch, users should also ensure they are using the
grpc.MaxConcurrentStreams
server option to apply a limit to the server's resources used for any single connection.Workarounds
None.
References
github.com/docker/distribution 2.7.1+incompatible
(golang)
pkg:golang/github.com/docker/[email protected]+incompatible
Undefined Behavior for Input to API
Affected range | <2.8.2-beta.1 |
Fixed version | 2.8.2-beta.1 |
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
Impact
Systems that run
distribution
built after a specific commit running on memory-restricted environments can suffer from denial of service by a crafted malicious/v2/_catalog
API endpoint request.Patches
Upgrade to at least 2.8.2-beta.1 if you are running
v2.8.x
release. If you use the code from the main branch, update at least to the commit after f55a6552b006a381d9167e328808565dd2bf77dc.Workarounds
There is no way to work around this issue without patching. Restrict access to the affected API endpoint: see the recommendations section.
References
/v2/_catalog
endpoint accepts a parameter to control the maximum amount of records returned (query string:n
).When not given the default
n=100
is used. The server trusts thatn
has an acceptable value, however when using a
maliciously large value, it allocates an array/slice ofn
of strings before filling the slice with data.This behaviour was introduced ~7yrs ago [1].
Recommendation
The
/v2/_catalog
endpoint was designed specifically to do registry syncs with search or other API systems. Such an endpoint would create a lot of load on the backend system, due to overfetch required to serve a request in certain implementations.Because of this, we strongly recommend keeping this API endpoint behind heightened privilege and avoiding leaving it exposed to the internet.
For more information
If you have any questions or comments about this advisory:
- Open an issue in distribution repository
- Email us at [email protected]
[1] faulty commit
Access of Resource Using Incompatible Type ('Type Confusion')
Affected range | <2.8.0 |
Fixed version | 2.8.0 |
CVSS Score | 3 |
CVSS Vector | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:L/A:N |
Description
Impact
Systems that rely on digest equivalence for image attestations may be vulnerable to type confusion.
Patches
Upgrade to at least
v2.8.0-beta.1
if you are runningv2.x
release. If you use the code from themain
branch, update at least to the commit after b59a6f827947f9e0e67df0cfb571046de4733586.Workarounds
There is no way to work around this issue without patching.
References
Due to an oversight in the OCI Image Specification that removed the embedded
mediaType
field from manifests, a maliciously crafted OCI Container Image can cause registry clients to parse the same image in two different ways without modifying the image’s digest by modifying theContent-Type
header returned by a registry. This can invalidate a common pattern of relying on container image digests for equivalence.For more information
If you have any questions or comments about this advisory:
- Open an issue in distribution
- Open an issue in distribution-spec
- Email us at [email protected]
OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
Affected range |
|
Fixed version | v2.8.0 |
Description
Impact
Systems that rely on digest equivalence for image attestations may be vulnerable to type confusion.
golang.org/x/text 0.3.7
(golang)
pkg:golang/golang.org/x/[email protected]
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 |
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
gopkg.in/yaml.v3 3.0.0-20210107192922-496545a6307b
(golang)
pkg:golang/gopkg.in/[email protected]
Deserialization of Untrusted Data
Affected range | <3.0.0-20220521103104-8f96da9f5d5e |
Fixed version | 3.0.0-20220521103104-8f96da9f5d5e |
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
An issue in the Unmarshal function in Go-Yaml v3 can cause a program to panic when attempting to deserialize invalid input.
golang.org/x/net 0.0.0-20220127200216-cd36cc0744dd
(golang)
pkg:golang/golang.org/x/[email protected]
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 |
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.
golang.org/x/sys 0.0.0-20220209214540-3681064d5158
(golang)
pkg:golang/golang.org/x/[email protected]
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 |
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
github.com/opencontainers/image-spec 1.0.2-0.20211117181255-693428a734f5
(golang)
pkg:golang/github.com/opencontainers/[email protected]
Access of Resource Using Incompatible Type ('Type Confusion')
Affected range | <1.0.2 |
Fixed version | 1.0.2 |
CVSS Score | 3 |
CVSS Vector | CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:N/I:L/A:N |
Description
Impact
In the OCI Image Specification version 1.0.1 and prior, manifest and index documents are not self-describing and documents with a single digest could be interpreted as either a manifest or an index.
Patches
The Image Specification will be updated to recommend that both manifest and index documents contain a
mediaType
field to identify the type of document.
Release v1.0.2 includes these updates.Workarounds
Software attempting to deserialize an ambiguous document may reject the document if it contains both “manifests” and “layers” fields or “manifests” and “config” fields.
References
For more information
If you have any questions or comments about this advisory:
OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities
Affected range | <1.0.2 |
Fixed version | 1.0.2 |
Description
Impact
In the OCI Image Specification version 1.0.1 and prior, manifest and index documents are not self-describing and documents with a single digest could be interpreted as either a manifest or an index.
Patches
The Image Specification will be updated to recommend that both manifest and index documents contain a
mediaType
field to identify the type of document.
Attempting automerge. See https://github.com/uniget-org/tools/actions/runs/7758770812. |
PR is clean and can be merged. See https://github.com/uniget-org/tools/actions/runs/7758770812. |
This PR contains the following updates:
1.40.10
->1.40.11
Warning
Some dependencies could not be looked up. Check the Dependency Dashboard for more information.
Release Notes
slimtoolkit/slim (slimtoolkit/slim)
v1.40.11
Compare Source
New Features
build
command flags (--include-dir-bins
and--include-ssh-client
).images
command to list container images.Improvements
xray
.xray
command reports to include object type information.Bug Fixes
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.