summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-sato/webkit/webkitgtk/CVE-2022-46700.patch67
-rw-r--r--meta/recipes-sato/webkit/webkitgtk_2.36.8.bb1
2 files changed, 68 insertions, 0 deletions
diff --git a/meta/recipes-sato/webkit/webkitgtk/CVE-2022-46700.patch b/meta/recipes-sato/webkit/webkitgtk/CVE-2022-46700.patch
new file mode 100644
index 0000000000..242b8337fa
--- /dev/null
+++ b/meta/recipes-sato/webkit/webkitgtk/CVE-2022-46700.patch
@@ -0,0 +1,67 @@
1From 86fbeb6fcd638e2350b09a43dde355f9830e75da Mon Sep 17 00:00:00 2001
2From: David Degazio <d_degazio@apple.com>
3Date: Tue, 8 Nov 2022 19:54:33 -0800
4Subject: [PATCH] Intl.Locale.prototype.hourCycles leaks empty JSValue to
5 script https://bugs.webkit.org/show_bug.cgi?id=247562 rdar://102031379
6
7Reviewed by Mark Lam.
8
9We currently don't check if IntlLocale::hourCycles returns a null JSArray, which allows it
10to be encoded as an empty JSValue and exposed to user code. This patch throws a TypeError
11when udatpg_open returns a failed status.
12
13* JSTests/stress/intl-locale-invalid-hourCycles.js: Added.
14(main):
15* Source/JavaScriptCore/runtime/IntlLocale.cpp:
16(JSC::IntlLocale::hourCycles):
17
18Canonical link: https://commits.webkit.org/256473@main
19
20CVE:CVE-2022-46700
21
22Upstream-Status: Backport
23[https://github.com/WebKit/WebKit/commit/86fbeb6fcd638e2350b09a43dde355f9830e75da]
24
25Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
26---
27 JSTests/stress/intl-locale-invalid-hourCycles.js | 12 ++++++++++++
28 Source/JavaScriptCore/runtime/IntlLocale.cpp | 4 +++-
29 2 files changed, 15 insertions(+), 1 deletion(-)
30 create mode 100644 JSTests/stress/intl-locale-invalid-hourCycles.js
31
32diff --git a/JSTests/stress/intl-locale-invalid-hourCycles.js b/JSTests/stress/intl-locale-invalid-hourCycles.js
33new file mode 100644
34index 000000000000..7b94eb844764
35--- /dev/null
36+++ b/JSTests/stress/intl-locale-invalid-hourCycles.js
37@@ -0,0 +1,12 @@
38+function main() {
39+ const v24 = new Intl.Locale("trimEnd", { 'numberingSystem': "foobar" });
40+ let empty = v24.hourCycles;
41+ print(empty);
42+}
43+
44+try {
45+ main();
46+} catch (e) {
47+ if (!(e instanceof TypeError))
48+ throw e;
49+}
50diff --git a/Source/JavaScriptCore/runtime/IntlLocale.cpp b/Source/JavaScriptCore/runtime/IntlLocale.cpp
51index c3c346163a18..bef424727a8a 100644
52--- a/Source/JavaScriptCore/runtime/IntlLocale.cpp
53+++ b/Source/JavaScriptCore/runtime/IntlLocale.cpp
54@@ -632,8 +632,10 @@ JSArray* IntlLocale::hourCycles(JSGlobalObject* globalObject)
55
56 UErrorCode status = U_ZERO_ERROR;
57 auto generator = std::unique_ptr<UDateTimePatternGenerator, ICUDeleter<udatpg_close>>(udatpg_open(m_localeID.data(), &status));
58- if (U_FAILURE(status))
59+ if (U_FAILURE(status)) {
60+ throwTypeError(globalObject, scope, "invalid locale"_s);
61 return nullptr;
62+ }
63
64 // Use "j" skeleton and parse pattern to retrieve the configured hour-cycle information.
65 constexpr const UChar skeleton[] = { 'j', 0 };
66--
672.40.0
diff --git a/meta/recipes-sato/webkit/webkitgtk_2.36.8.bb b/meta/recipes-sato/webkit/webkitgtk_2.36.8.bb
index 062f209932..edd64b7b11 100644
--- a/meta/recipes-sato/webkit/webkitgtk_2.36.8.bb
+++ b/meta/recipes-sato/webkit/webkitgtk_2.36.8.bb
@@ -20,6 +20,7 @@ SRC_URI = "https://www.webkitgtk.org/releases/${BP}.tar.xz \
20 file://CVE-2022-46691.patch \ 20 file://CVE-2022-46691.patch \
21 file://CVE-2022-46699.patch \ 21 file://CVE-2022-46699.patch \
22 file://CVE-2022-42867.patch \ 22 file://CVE-2022-42867.patch \
23 file://CVE-2022-46700.patch \
23 " 24 "
24SRC_URI[sha256sum] = "0ad9fb6bf28308fe3889faf184bd179d13ac1b46835d2136edbab2c133d00437" 25SRC_URI[sha256sum] = "0ad9fb6bf28308fe3889faf184bd179d13ac1b46835d2136edbab2c133d00437"
25 26