commit:     34c67cbd5d13469221f14e46981a8e6a91fb2068
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 31 03:49:37 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Wed Jul 31 03:51:38 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34c67cbd

app-text/calibre: backport fix for CVE-2024-7008 to 5.44

Although 4 CVEs were fixed in 7.16.0, only one of them (relatively
minor) is present in 5.x.

Bug: https://bugs.gentoo.org/936961
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 ...e-5.44.0-r4.ebuild => calibre-5.44.0-r5.ebuild} |  2 ++
 .../files/calibre-5.44.0-xss-backport.patch        | 33 ++++++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/app-text/calibre/calibre-5.44.0-r4.ebuild 
b/app-text/calibre/calibre-5.44.0-r5.ebuild
similarity index 99%
rename from app-text/calibre/calibre-5.44.0-r4.ebuild
rename to app-text/calibre/calibre-5.44.0-r5.ebuild
index 2c00399d5c90..48b7aadde2b2 100644
--- a/app-text/calibre/calibre-5.44.0-r4.ebuild
+++ b/app-text/calibre/calibre-5.44.0-r5.ebuild
@@ -135,6 +135,8 @@ PATCHES=(
        "${FILESDIR}"/${P}-icu75.patch
        # backport test-only fix for lxml 5
        "${FILESDIR}"/e9cc00560a28f56a303cca97630ab58e519dd9c8.patch
+       # Security backport for CVE-2024-7008
+       "${FILESDIR}"/${P}-xss-backport.patch
 )
 
 src_prepare() {

diff --git a/app-text/calibre/files/calibre-5.44.0-xss-backport.patch 
b/app-text/calibre/files/calibre-5.44.0-xss-backport.patch
new file mode 100644
index 000000000000..83bb8cca8cf5
--- /dev/null
+++ b/app-text/calibre/files/calibre-5.44.0-xss-backport.patch
@@ -0,0 +1,33 @@
+Changelog:
+
+Only relevant if you embed the calibre server within a larger server, it
+means attackers who can convince users to click on a specially crafted
+link, can run JavaScript code with the same origin as the larger server
+calibre is embedded in.
+
+From e75f85919a3c3a5f2d87861050d8483d66561c06 Mon Sep 17 00:00:00 2001
+From: Kovid Goyal <[email protected]>
+Date: Tue, 30 Jul 2024 13:40:21 +0530
+Subject: [PATCH] Fix #2075130 [Private
+ bug](https://bugs.launchpad.net/calibre/+bug/2075130)
+
+---
+ src/calibre/srv/legacy.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/calibre/srv/legacy.py b/src/calibre/srv/legacy.py
+index 055228ebee..85586b07a6 100644
+--- a/src/calibre/srv/legacy.py
++++ b/src/calibre/srv/legacy.py
+@@ -255,7 +255,7 @@ def browse(ctx, rd, rest):
+     if rest.startswith('book/'):
+         # implementation of https://bugs.launchpad.net/calibre/+bug/1698411
+         # redirect old server book URLs to new URLs
+-        redirect = ctx.url_for(None) + '#book_id=' + rest[5:] + 
"&amp;panel=book_details"
++        redirect = ctx.url_for(None) + '#book_id=' + int(rest[5:]) + 
"&amp;panel=book_details"
+         from lxml import etree as ET
+         return html(ctx, rd, endpoint,
+                  E.html(E.head(
+-- 
+2.44.2
+

Reply via email to