Skip to content

Commit ba6abbc

Browse files
Patch blobfuse2 for CVE-2025-30204
1 parent 0802fcd commit ba6abbc

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
From 6c3e689ca1426d2b820d1d48f45751ca6a452414 Mon Sep 17 00:00:00 2001
2+
From: Azure Linux Security Servicing Account
3+
4+
Date: Fri, 11 Jul 2025 08:35:35 +0000
5+
Subject: [PATCH] Fix CVE CVE-2025-30204 in blobfuse2
6+
7+
Upstream Patch Reference: https://github.com/golang-jwt/jwt/commit/2f0e9add62078527821828c76865661aa7718a84.patch
8+
---
9+
vendor/github.com/golang-jwt/jwt/v4/parser.go | 36 +++++++++++++++++--
10+
1 file changed, 33 insertions(+), 3 deletions(-)
11+
12+
diff --git a/vendor/github.com/golang-jwt/jwt/v4/parser.go b/vendor/github.com/golang-jwt/jwt/v4/parser.go
13+
index c0a6f69..8e7e67c 100644
14+
--- a/vendor/github.com/golang-jwt/jwt/v4/parser.go
15+
+++ b/vendor/github.com/golang-jwt/jwt/v4/parser.go
16+
@@ -7,6 +7,8 @@ import (
17+
"strings"
18+
)
19+
20+
+const tokenDelimiter = "."
21+
+
22+
type Parser struct {
23+
// If populated, only these methods will be considered valid.
24+
//
25+
@@ -123,9 +125,10 @@ func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyf
26+
// It's only ever useful in cases where you know the signature is valid (because it has
27+
// been checked previously in the stack) and you want to extract values from it.
28+
func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Token, parts []string, err error) {
29+
- parts = strings.Split(tokenString, ".")
30+
- if len(parts) != 3 {
31+
- return nil, parts, NewValidationError("token contains an invalid number of segments", ValidationErrorMalformed)
32+
+ var ok bool
33+
+ parts, ok = splitToken(tokenString)
34+
+ if !ok {
35+
+ return nil, nil, NewValidationError("token contains an invalid number of segments", ValidationErrorMalformed)
36+
}
37+
38+
token = &Token{Raw: tokenString}
39+
@@ -175,3 +178,30 @@ func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Toke
40+
41+
return token, parts, nil
42+
}
43+
+
44+
+// splitToken splits a token string into three parts: header, claims, and signature. It will only
45+
+// return true if the token contains exactly two delimiters and three parts. In all other cases, it
46+
+// will return nil parts and false.
47+
+func splitToken(token string) ([]string, bool) {
48+
+ parts := make([]string, 3)
49+
+ header, remain, ok := strings.Cut(token, tokenDelimiter)
50+
+ if !ok {
51+
+ return nil, false
52+
+ }
53+
+ parts[0] = header
54+
+ claims, remain, ok := strings.Cut(remain, tokenDelimiter)
55+
+ if !ok {
56+
+ return nil, false
57+
+ }
58+
+ parts[1] = claims
59+
+ // One more cut to ensure the signature is the last part of the token and there are no more
60+
+ // delimiters. This avoids an issue where malicious input could contain additional delimiters
61+
+ // causing unecessary overhead parsing tokens.
62+
+ signature, _, unexpected := strings.Cut(remain, tokenDelimiter)
63+
+ if unexpected {
64+
+ return nil, false
65+
+ }
66+
+ parts[2] = signature
67+
+
68+
+ return parts, true
69+
+}
70+
--
71+
2.45.3
72+

SPECS/blobfuse2/blobfuse2.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Summary: FUSE adapter - Azure Storage
88
Name: blobfuse2
99
Version: %{blobfuse2_version}
10-
Release: 8%{?dist}
10+
Release: 9%{?dist}
1111
License: MIT
1212
Vendor: Microsoft Corporation
1313
Distribution: Mariner
@@ -38,6 +38,7 @@ Source1: %{name}-%{version}-vendor.tar.gz
3838
Patch0: CVE-2023-45288.patch
3939
Patch1: CVE-2024-24786.patch
4040
Patch2: CVE-2025-22868.patch
41+
Patch3: CVE-2025-30204.patch
4142
BuildRequires: cmake
4243
BuildRequires: fuse3-devel
4344
BuildRequires: gcc
@@ -82,6 +83,9 @@ install -D -m 0644 ./setup/blobfuse2-logrotate %{buildroot}%{_sysconfdir}/logrot
8283
%{_sysconfdir}/logrotate.d/blobfuse2
8384

8485
%changelog
86+
* Fri Jul 11 2025 Azure Linux Security Servicing Account <[email protected]> - 2.1.2-9
87+
- Patch for CVE-2025-30204
88+
8589
* Sun Mar 02 2025 Kanishk Bansal <[email protected]> - 2.1.2-8
8690
- Fix CVE-2025-22868 with an upstream patch
8791

0 commit comments

Comments
 (0)