Commit Graph

67 Commits

Author SHA1 Message Date
jvoisin
224915bba1 Prevent XXE in epub/fb2/goodreads API
The lxml.etree.fromstring() function use the default XML parser, which resolves
external entities because XML handling defaults in Python sucks. There is no
need for such dangerous misfeatures in calibre-web, so let's disable it.

A user able to upload epub/fb2 could add something like this to the file:

```xml
<?xml version="1.0"?>
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]>
<container><rootfiles><rootfile full-path="&xxe;"/></rootfiles></container>
```

and obtain the content of the `/etc/passwd` file, which is bad™.
2026-04-14 22:12:57 +02:00
Ozzie Isaacs
80bcfb12de Add UniDecodeError to catched errors during kobo sync check layout 2025-03-23 08:41:18 +01:00
Ozzie Isaacs
0f9b5d08e9 Fix cover handling on upload formats 2024-08-18 10:59:39 +02:00
Ozzie Isaacs
87b82424d5 Improved whitespace removal
Testresults
2024-08-13 07:07:54 +02:00
Ozzie Isaacs
64e4a1155c Code cosmetics
Bugfix missing bleach tags (#3080)
Bugfix pdfreader
2024-06-20 19:12:46 +02:00
Ozzie Isaacs
e591211b57 Fix for #3037 (catch OError on detect epub layout) 2024-04-27 07:22:58 +02:00
Ozzie Isaacs
3814fbf08f Bugfixes from testrun 2024-01-14 14:28:08 +01:00
Ozzie Isaacs
74c61d9685 Merge branch 'metadata' into Develop 2024-01-13 14:47:48 +01:00
Ozzie Isaacs
b8031cd53f Add possibility to replace kepub metadata on download 2024-01-13 14:31:42 +01:00
Ozzie Isaacs
902fa254b0 Merge branch 'master' into Develop 2024-01-07 08:03:40 +01:00
Ozzie Isaacs
977f07364b Fix for #2961 (empty comment with newline causes error 500 on upload)
Language of error message for kobo sync improved
2024-01-06 16:08:14 +01:00
Ozzie Isaacs
d68e57c4fc Implement split library and books
Bugfix arrows in comic reader
Fix kobo download link
Updated requirement
2023-11-08 20:11:03 +01:00
Ozzie Isaacs
34c6010ad0 Catch additional error during kobo detect layout 2023-07-30 19:57:42 +02:00
Ozzie Isaacs
2f12b2e315 Handle invalid or missing container.xml during kobo sync (Fix for #2840) 2023-07-29 15:32:35 +02:00
Ozzie Isaacs
7ff4747f63 Bugfix after merge 2023-02-27 13:17:34 +01:00
Ozzie Isaacs
a414db0243 Merge remote-tracking branch 'fixed_layout/kobo-sync-detect-fixed-layout'
# Conflicts:
#	cps/kobo.py
2023-02-25 15:26:49 +01:00
Ozzie Isaacs
162ac73bee Bugfixes from testrun 2023-02-22 18:59:11 +01:00
Ozzie Isaacs
856dce8add Merge remote-tracking branch 'refactor_epub/refactor_epub'
# Conflicts:
#	cps/epub.py
2023-02-21 20:47:10 +01:00
Ozzie Isaacs
8dd4d0be1b Merge handle epub iodentifier 2023-01-23 12:55:09 +01:00
Ozzie Isaacs
43ee85fbb5 Removed unnecessary Unicode "u" 2023-01-21 15:23:18 +01:00
Benedikt McMullin
fba95956de epub: Skip invalid dc:identifier 2023-01-02 21:21:43 +01:00
jvoisin
631496775e Minor code refactorisation of epub.py
- Reduce the amount of nested indentation
- Use proper functions instead of fragile manual parsing
2022-12-25 16:37:58 +01:00
Ozzie Isaacs
59a5ccd05c Bugfixes after testrun 2022-09-25 19:36:40 +02:00
Evan Peterson
7ae9f89bbf Merge branch 'Develop' into kobo-sync-detect-fixed-layout 2022-05-14 10:02:31 -04:00
Wulf Rajek
2d0af0ab49 Add pubdate, publisher and identifiers metadata #2163 2022-04-05 01:26:35 +01:00
Ozzie Isaacs
4545f4a20d Better epub cover parsing with multiple cover-image items
Code cosmetics
renamed variables
refactored xml page generation
refactored prepare author
2022-03-13 19:00:37 +01:00
Ozzie Isaacs
8e2536c53b Improved cover extraction for epub files 2022-03-12 18:01:11 +01:00
Ozzie Isaacs
411c13977f Fix for #2294 (cover files in epubs with property as property in manifest are now found) 2022-02-06 16:22:28 +01:00
Evan Peterson
4eaa9413f9 Kobo metadata return correct layout format for fixed layout 2022-01-10 15:15:19 -05:00
Ozzie Isaacs
ed26d34961 Code cleaning (remove python2) 2021-10-04 19:23:24 +02:00
Ozzie Isaacs
2b17bf4114 Update tests
Fixes upload book
2021-03-23 18:57:04 +01:00
Ozzie Isaacs
59ebc1af8a Code refactoring 2021-03-21 08:20:04 +01:00
Ozzie Isaacs
fcf9e7a1ef Upload pdf fixes:
Handle no title
Handle no author
Fix import of more than one language
Add missing pdf upload publisher handling
2021-03-17 19:06:51 +01:00
jvoisin
700b0609df Don't recompute metadata for epubs 2020-11-06 21:36:49 +01:00
Ozzieisaacs
4cf71dd336 Fix "is not a valid language" on upload 2020-09-20 11:41:44 +02:00
OzzieIsaacs
45ff9394f2 Fix comma separated author names during for upload 2020-08-23 09:44:42 +02:00
Ozzieisaacs
329a7a03a5 Fix for errors editing/uploading books with duplicate tags/authors/language names
Additional parsing of epubs for cover files
Fix for change of database with linked read_column and read column isn't present any more
2020-06-22 19:11:58 +02:00
Ozzieisaacs
2ea45b1fdc Removed shebang on non executable scripts 2020-02-10 18:37:47 +01:00
Ozzieisaacs
eede894e72 Merge remote-tracking branch 'merge-metadata' 2019-12-09 20:53:16 +01:00
Ozzieisaacs
a371e40c66 Merge remote-tracking branch 'github_3/hotfix/epub-import'
Improved cover extraction from epub files
2019-10-20 15:48:06 +02:00
Jan Guzej
c7d7a7597c remove language from array metadata 2019-10-19 21:49:18 +02:00
Jan Guzej
fbb7663a2f epub metadata import fix 2019-10-19 14:04:15 -04:00
Ozzieisaacs
4708347c16 Merge branch 'Develop'
# Conflicts:
#	MANIFEST.in
#	README.md
#	cps/helper.py
#	cps/static/js/archive/archive.js
#	cps/translations/nl/LC_MESSAGES/messages.mo
#	cps/translations/nl/LC_MESSAGES/messages.po
#	cps/ub.py
#	cps/updater.py
#	cps/web.py
#	cps/worker.py
#	optional-requirements.txt
2019-07-13 20:54:21 +02:00
Daniel Pavel
f7e640fd98 support pycountry if iso-639 is not available 2019-03-29 07:00:10 +02:00
Ozzieisaacs
836c6fd245 Updated translations
Added license texts in flies
2019-01-20 19:37:45 +01:00
OzzieIsaacs
f1fac28203 Improved error handling for renaming authors and titles (changes related to filesystem and not only to database) 2017-11-30 16:49:46 +01:00
kyos
51bc0e82a4 Added series and series_index metadata handler 2017-07-31 09:00:09 +02:00
kyos
4bba3558b7 Added tags metadata handler for epubs 2017-07-31 08:46:29 +02:00
Matt Hazinski
6f7a240ce2 Ensure file paths in uploads are non-empty, fix #183 (#184)
* Ensure file paths in uploads are non-empty, fix #183

* Fix AttributeError in process(), handle strings of spaces
2017-04-23 07:22:10 +01:00
OzzieIsaacs
00462237fe Merge remote-tracking branch 'chinese_translation/master' 2017-03-31 16:52:25 +02:00