diff --git a/meta/recipes-core/expat/expat/CVE-2026-124317_p1.patch b/meta/recipes-core/expat/expat/CVE-2026-124317_p1.patch
new file mode 100644
index 00000000000..d37356d3090
--- /dev/null
+++ b/meta/recipes-core/expat/expat/CVE-2026-124317_p1.patch
@@ -0,0 +1,56 @@
+From 3d77567612994172f9d09b46f31bb604e16fb08d Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Fri, 6 Nov 2026 18:35:50 +0100
+Subject: [PATCH] lib: Reject overread in `unknown_toUtf8` and
+ `unknown_toUtf16`
+
+CVE: CVE-2026-124317
+Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/3d77567612994172f9d09b46f31bb604e16fb08d]
+
+Signed-off-by: Darsh Kelaiya <dkelaiya@cisco.com>
+---
+ lib/xmltok.c | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/lib/xmltok.c b/lib/xmltok.c
+index a3bf5e0e95b0..72758d734a44 100644
+--- a/lib/xmltok.c
++++ b/lib/xmltok.c
+@@ -1447,13 +1447,17 @@ unknown_toUtf8(const ENCODING *enc, const char **fromP, const char *fromLim,
+     utf8 = uenc->utf8[(unsigned char)**fromP];
+     n = *utf8++;
+     if (n == 0) {
++      const size_t readLen
++          = (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP]
++             - (BT_LEAD2 - 2));
++      if (readLen > (size_t)(fromLim - *fromP))
++        return XML_CONVERT_INPUT_INCOMPLETE;
+       int c = uenc->convert(uenc->userData, *fromP);
+       n = XmlUtf8Encode(c, buf);
+       if (n > toLim - *toP)
+         return XML_CONVERT_OUTPUT_EXHAUSTED;
+       utf8 = buf;
+-      *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP]
+-                 - (BT_LEAD2 - 2));
++      *fromP += readLen;
+     } else {
+       if (n > toLim - *toP)
+         return XML_CONVERT_OUTPUT_EXHAUSTED;
+@@ -1471,9 +1475,13 @@ unknown_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim,
+   while (*fromP < fromLim && *toP < toLim) {
+     unsigned short c = uenc->utf16[(unsigned char)**fromP];
+     if (c == 0) {
++      const size_t readLen
++          = (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP]
++             - (BT_LEAD2 - 2));
++      if (readLen > (size_t)(fromLim - *fromP))
++        return XML_CONVERT_INPUT_INCOMPLETE;
+       c = (unsigned short)uenc->convert(uenc->userData, *fromP);
+-      *fromP += (AS_NORMAL_ENCODING(enc)->type[(unsigned char)**fromP]
+-                 - (BT_LEAD2 - 2));
++      *fromP += readLen;
+     } else
+       (*fromP)++;
+     *(*toP)++ = c;
+-- 
+2.35.6
diff --git a/meta/recipes-core/expat/expat/CVE-2026-124317_p2.patch b/meta/recipes-core/expat/expat/CVE-2026-124317_p2.patch
new file mode 100644
index 00000000000..3d592808d6b
--- /dev/null
+++ b/meta/recipes-core/expat/expat/CVE-2026-124317_p2.patch
@@ -0,0 +1,108 @@
+From 05075975dc246f5f6c0757d532f22f518850e7af Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Fri, 6 Nov 2026 18:22:39 +0100
+Subject: [PATCH] tests: Cover overread in `unknown_toUtf8`
+
+CVE: CVE-2026-124317
+Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/05075975dc246f5f6c0757d532f22f518850e7af]
+
+Backport Changes:
+- Use XML_GetBuffer instead of XML_GetBuffer64. Expat 2.8.5 lacks the
+  64-bit API; the fixed test document fits in int, so cast its length
+  for the existing XML_GetBuffer interface.
+- Use the existing xcstrcmp test helper from common.h for the
+  XML_Char encoding-name comparison.
+
+Signed-off-by: Darsh Kelaiya <dkelaiya@cisco.com>
+---
+ tests/misc_tests.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 68 insertions(+)
+
+diff --git a/tests/misc_tests.c b/tests/misc_tests.c
+index 717cc2dd31aa..814fb84aa6d8 100644
+--- a/tests/misc_tests.c
++++ b/tests/misc_tests.c
+@@ -894,6 +894,73 @@ START_TEST(test_misc_unknown_encoding_callbacks_protected) {
+ }
+ END_TEST
+ 
++struct DecoderInfo {
++  size_t docLen;
++  const char *buffer;
++};
++
++static int
++decodeUnknownEncoding(void *data, const char *s) {
++  struct DecoderInfo *const info = data;
++  assert_true(info != NULL);
++
++  // Determine the sequence length in accordence with encoding map
++  const unsigned char lead = (unsigned char)s[0];
++  const int length = (lead == 0xC3) ? 2 : ((lead == 0xA9) ? 4 : 1);
++
++  const size_t offset = s - info->buffer;
++  assert_true(offset + length <= info->docLen); // or we would overread
++
++  if (lead == 0xC3 && (unsigned char)s[1] == 0xA9)
++    return 0x49;
++
++  return -1;
++}
++
++static int
++unknown_encoding_handler(void *data, const XML_Char *name, XML_Encoding *info) {
++  XML_Char *const expectedEncodingName = xcsdup_str("x-q5");
++  assert_true(expectedEncodingName != NULL);
++  assert_true(xcstrcmp(name, expectedEncodingName) == 0);
++  free(expectedEncodingName);
++
++  for (int i = 0; i < 256; i++)
++    info->map[i] = (i < 128) ? i : -1;
++
++  info->map[0xC3] = -2;
++  info->map[0xA9] = -4;
++
++  info->convert = decodeUnknownEncoding;
++  info->data = data;
++  info->release = NULL;
++
++  return XML_STATUS_OK;
++}
++
++START_TEST(test_misc_unknown_encoding_no_source_overread) {
++  const char *const doc = "<?xml \xC3\xA9?>";
++  const size_t docLen = strlen(doc);
++
++  XML_Char *const encodingName = xcsdup_str("x-q5");
++  assert_true(encodingName != NULL);
++
++  XML_Parser parser = XML_ParserCreate(encodingName);
++
++  char *const buffer = XML_GetBuffer(parser, (int)docLen);
++  assert_true(buffer != NULL);
++  memcpy(buffer, doc, docLen);
++
++  struct DecoderInfo info = {docLen, buffer};
++  XML_SetUnknownEncodingHandler(parser, unknown_encoding_handler, &info);
++
++  assert_true(XML_ParseBuffer(parser, docLen, /*isFinal=*/XML_TRUE)
++              == XML_STATUS_ERROR);
++
++  XML_ParserFree(parser);
++  free(encodingName);
++}
++END_TEST
++
+ // General attack payload idea by Jason Kratzer of Mozilla
+ START_TEST(test_misc_low_surrogate_mozilla_bug_2053153) {
+   const char doc_before[] = "<\0!\0D\0O\0C\0T\0Y\0P\0E\0 \0d\0 \0[\0\n\0"
+@@ -992,6 +1059,7 @@ make_miscellaneous_test_case(Suite *s) {
+   tcase_add_test(tc_misc, test_misc_calls_forbidden_from_handlers);
+   tcase_add_test(tc_misc, test_misc_resume_parser_forbidden_from_handler);
+   tcase_add_test(tc_misc, test_misc_unknown_encoding_callbacks_protected);
++  tcase_add_test(tc_misc, test_misc_unknown_encoding_no_source_overread);
+   tcase_add_test(tc_misc, test_misc_input_2gb);
+   tcase_add_test(tc_misc, test_misc_low_surrogate_mozilla_bug_2053153);
+ }
+-- 
+2.35.6
diff --git a/meta/recipes-core/expat/expat_2.8.5.bb b/meta/recipes-core/expat/expat_2.8.5.bb
index f380aab56fa..7116ea3dfad 100644
--- a/meta/recipes-core/expat/expat_2.8.5.bb
+++ b/meta/recipes-core/expat/expat_2.8.5.bb
@@ -24,6 +24,8 @@ SRC_URI = "${GITHUB_BASE_URI}/download/R_${VERSION_TAG}/expat-${PV}.tar.bz2  \
            file://CVE-2026-115506_p1.patch \
            file://CVE-2026-115506_p2.patch \
            file://CVE-2026-115506_p3.patch \
+           file://CVE-2026-124317_p1.patch \
+           file://CVE-2026-124317_p2.patch \
            "
 
 GITHUB_BASE_URI = "https://github.com/libexpat/libexpat/releases/"
