Skip to content
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 module golang.org/x/crypto to v0.17.0 [security] (main) #11522

Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 18, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
golang.org/x/crypto v0.14.0 -> v0.17.0 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2023-48795

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 (*[email protected] 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 (*[email protected]), 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.


Configuration

📅 Schedule: Branch creation - "" (UTC), 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 these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot requested a review from a team as a code owner December 18, 2023 23:41
@renovate renovate bot added area/security dependencies Pull requests that update a dependency file labels Dec 18, 2023
Copy link
Contributor

github-actions bot commented Dec 18, 2023

Trivy scan found the following vulnerabilities:

  • HIGH, Target: docker.io/grafana/loki:main-d7f945c (alpine 3.18.4), Type: alpine openssl: Incorrect cipher key and IV length processing in libcrypto3 v3.1.3-r0. Fixed in v3.1.4-r0
  • HIGH, Target: docker.io/grafana/loki:main-d7f945c (alpine 3.18.4), Type: alpine openssl: Incorrect cipher key and IV length processing in libssl3 v3.1.3-r0. Fixed in v3.1.4-r0
    \nTo see more details on these vulnerabilities, and how/where to fix them, please run docker build -t grafana/loki:main-d7f945c -f cmd/loki/Dockerfile .
    trivy i grafana/loki:main-d7f945c on your branch. If these were not introduced by your PR, please considering fixing them in via a subsequent PR. Thanks!

@renovate renovate bot force-pushed the deps-update/main-go-golang.org/x/crypto-vulnerability branch from b8868fb to fb940d0 Compare December 19, 2023 08:51
@renovate renovate bot changed the title fix(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Dec 19, 2023
@renovate renovate bot changed the title chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) Dec 19, 2023
@renovate renovate bot changed the title Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Dec 20, 2023
@renovate renovate bot changed the title chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) Jan 2, 2024
@renovate renovate bot changed the title Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Jan 4, 2024
@renovate renovate bot changed the title chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) Jan 5, 2024
@renovate renovate bot changed the title Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Jan 8, 2024
@renovate renovate bot changed the title chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) Jan 8, 2024
@renovate renovate bot changed the title Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Jan 9, 2024
@renovate renovate bot changed the title chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) Jan 9, 2024
@renovate renovate bot force-pushed the deps-update/main-go-golang.org/x/crypto-vulnerability branch from fb940d0 to 0f285e8 Compare January 9, 2024 19:23
@renovate renovate bot changed the title Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Jan 11, 2024
@renovate renovate bot changed the title chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) Jan 11, 2024
@renovate renovate bot changed the title Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Jan 11, 2024
@renovate renovate bot changed the title chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) Jan 12, 2024
@renovate renovate bot changed the title Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Jan 14, 2024
@renovate renovate bot changed the title chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) Jan 16, 2024
@renovate renovate bot changed the title Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Jan 17, 2024
@renovate renovate bot changed the title chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) Jan 17, 2024
@renovate renovate bot changed the title Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Jan 17, 2024
@renovate renovate bot changed the title chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) Jan 19, 2024
@renovate renovate bot changed the title Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Jan 19, 2024
@renovate renovate bot changed the title chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) Jan 23, 2024
@renovate renovate bot changed the title Update module golang.org/x/crypto to v0.17.0 [SECURITY] (main) chore(deps): update module golang.org/x/crypto to v0.17.0 [security] (main) Jan 24, 2024
@poyzannur
Copy link
Contributor

@poyzannur poyzannur merged commit a627fb6 into main Jan 24, 2024
8 checks passed
@poyzannur poyzannur deleted the deps-update/main-go-golang.org/x/crypto-vulnerability branch January 24, 2024 09:30
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
…(main) (grafana#11522)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| golang.org/x/crypto | `v0.14.0` -> `v0.17.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/golang.org%2fx%2fcrypto/v0.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/golang.org%2fx%2fcrypto/v0.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/golang.org%2fx%2fcrypto/v0.14.0/v0.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/golang.org%2fx%2fcrypto/v0.14.0/v0.17.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

### GitHub Vulnerability Alerts

####
[CVE-2023-48795](https://github.com/warp-tech/russh/security/advisories/GHSA-45x7-px36-x8w8)

### 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@&grafana#8203;openssh.com) and Encrypt-then-MAC
(*[email protected] 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](https://terrapin-attack.com).

### Impact

This attack targets the specification of ChaCha20-Poly1305
(chacha20-poly1305@&grafana#8203;openssh.com) and Encrypt-then-MAC
(*[email protected]), 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.

---

### Configuration

📅 **Schedule**: Branch creation - "" (UTC), 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 these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/grafana/loki).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy45My4xIiwidXBkYXRlZEluVmVyIjoiMzcuMTM1LjAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security dependencies Pull requests that update a dependency file size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants