Skip to content

Commit 2b9c990

Browse files
committed
(PA-6878) Patch agent-runtime-7.x and main Curl for CVE-2024-7264
1 parent d9873e5 commit 2b9c990

File tree

3 files changed

+88
-3
lines changed

3 files changed

+88
-3
lines changed

configs/components/curl.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
case version
77
when '7.88.1'
88
pkg.sha256sum 'cdb38b72e36bc5d33d5b8810f8018ece1baa29a8f215b4495e495ded82bbf3c7'
9-
when '8.7.1'
10-
pkg.sha256sum 'f91249c87f68ea00cf27c44fdfa5a78423e41e71b7d408e5901a9896d905c495'
9+
when '8.9.1'
10+
pkg.sha256sum '291124a007ee5111997825940b3876b3048f7d31e73e9caa681b80fe48b2dcd5'
1111
else
1212
raise "curl version #{version} has not been configured; Cannot continue."
1313
end
@@ -47,6 +47,7 @@
4747
pkg.apply_patch 'resources/patches/curl/CVE-2023-46218.patch'
4848
pkg.apply_patch 'resources/patches/curl/CVE-2024-2004.patch'
4949
pkg.apply_patch 'resources/patches/curl/CVE-2024-2398.patch'
50+
pkg.apply_patch 'resources/patches/curl/CVE-2024-7264.patch'
5051
end
5152

5253
configure_options = []

configs/projects/agent-runtime-main.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
proj.setting :augeas_version, '1.14.1'
1515
end
1616

17-
proj.setting :curl_version, '8.7.1'
17+
proj.setting :curl_version, '8.9.1'
1818

1919
########
2020
# Load shared agent settings
+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
--- a/lib/x509asn1.c
2+
+++ b/lib/x509asn1.c
3+
@@ -493,12 +493,13 @@ static const char *GTime2str(const char
4+
fracl = 0; /* no fractional seconds detected so far */
5+
if(fracp < end && (*fracp == '.' || *fracp == ',')) {
6+
/* Have fractional seconds, e.g. "[.,]\d+". How many? */
7+
- tzp = fracp++; /* should be a digit char or BAD ARGUMENT */
8+
+ fracp++; /* should be a digit char or BAD ARGUMENT */
9+
+ tzp = fracp;
10+
while(tzp < end && ISDIGIT(*tzp))
11+
tzp++;
12+
if(tzp == fracp) /* never looped, no digit after [.,] */
13+
return CURLE_BAD_FUNCTION_ARGUMENT;
14+
- fracl = tzp - fracp - 1; /* number of fractional sec digits */
15+
+ fracl = tzp - fracp; /* number of fractional sec digits */
16+
DEBUGASSERT(fracl > 0);
17+
/* Strip trailing zeroes in fractional seconds.
18+
* May reduce fracl to 0 if only '0's are present. */
19+
@@ -507,18 +508,24 @@ static const char *GTime2str(const char
20+
}
21+
22+
/* Process timezone. */
23+
- if(tzp >= end)
24+
- ; /* Nothing to do. */
25+
+ if(tzp >= end) {
26+
+ tzp = "";
27+
+ tzl = 0;
28+
+ }
29+
else if(*tzp == 'Z') {
30+
- tzp = " GMT";
31+
- end = tzp + 4;
32+
+ sep = " ";
33+
+ tzp = "GMT";
34+
+ tzl = 3;
35+
+ }
36+
+ else if((*tzp == '+') || (*tzp == '-')) {
37+
+ sep = " UTC";
38+
+ tzl = end - tzp;
39+
}
40+
else {
41+
sep = " ";
42+
- tzp++;
43+
+ tzl = end - tzp;
44+
}
45+
46+
- tzl = end - tzp;
47+
return curl_maprintf("%.4s-%.2s-%.2s %.2s:%.2s:%c%c%s%.*s%s%.*s",
48+
beg, beg + 4, beg + 6,
49+
beg + 8, beg + 10, sec1, sec2,
50+
@@ -526,6 +533,15 @@ static const char *GTime2str(const char
51+
sep, tzl, tzp);
52+
}
53+
54+
+#ifdef UNITTESTS
55+
+/* used by unit1656.c */
56+
+CURLcode Curl_x509_GTime2str(struct dynbuf *store,
57+
+ const char *beg, const char *end)
58+
+{
59+
+ return GTime2str(store, beg, end);
60+
+}
61+
+#endif
62+
+
63+
/*
64+
* Convert an ASN.1 UTC time to a printable string.
65+
* Return the dynamically allocated string, or NULL if an error occurs.
66+
--- a/lib/x509asn1.h
67+
+++ b/lib/x509asn1.h
68+
@@ -130,5 +130,16 @@ CURLcode Curl_extract_certinfo(struct co
69+
const char *beg, const char *end);
70+
CURLcode Curl_verifyhost(struct connectdata *conn,
71+
const char *beg, const char *end);
72+
+
73+
+#ifdef UNITTESTS
74+
+#if defined(USE_GNUTLS) || defined(USE_SCHANNEL) || defined(USE_SECTRANSP) || \
75+
+ defined(USE_MBEDTLS)
76+
+
77+
+/* used by unit1656.c */
78+
+CURLcode Curl_x509_GTime2str(struct dynbuf *store,
79+
+ const char *beg, const char *end);
80+
+#endif
81+
+#endif
82+
+
83+
#endif /* USE_GSKIT or USE_NSS or USE_GNUTLS or USE_WOLFSSL or USE_SCHANNEL */
84+
#endif /* HEADER_CURL_X509ASN1_H */

0 commit comments

Comments
 (0)