Skip to content

Kobo Subtitle configuration option#3376

Open
AsherMaximum wants to merge 23 commits into
janeczku:masterfrom
AsherMaximum:subtitle-config
Open

Kobo Subtitle configuration option#3376
AsherMaximum wants to merge 23 commits into
janeczku:masterfrom
AsherMaximum:subtitle-config

Conversation

@AsherMaximum
Copy link
Copy Markdown
Contributor

Expanding on #3358 to make the subtitle sent to Kobo devices a config setting

OzzieIsaacs and others added 23 commits March 7, 2026 09:36
Remote login tokens are generated from only 4 bytes of randomness (32 bits = ~4
billion possibilities, 8 hex characters). The /ajax/verify_token endpoint at
remotelogin.py:98 has no rate limiting. The token is valid for 10 minutes.

At even modest request rates (10,000 req/sec), an attacker can test ~6 million
tokens during the 10-minute window , which isn't enough to exhaust the full
space, sure, but combined with multiple concurrent login sessions (each
generating a new token), or if the attacker can trigger the victim to initiate
remote login, the attack becomes more feasible. Compare with the Kobo auth
token which uses urandom(16) (128 bits).
Custom columns of type comments are rendered with `|safe` (disabling Jinja2
auto-escaping) and no `clean_string` sanitization. Compare with regular book
comments which correctly use `{{ entry.comments[0].text|clean_string|safe }}`.

Any user with edit permissions can set a custom comment column to
`<script>alert(document.cookie)</script>` and it will execute for every user who
views the book detail page or the OPDS feed. This is stored XSS with no
authentication barrier beyond edit permission.
Multiple Kobo API endpoints use calibre_db.get_book_by_uuid() at db.py:748-749,
which performs a raw unfiltered query, meaning that common_filters() isn't
applied, so tag-based ACLs, language restrictions, and archived-book filtering
are all bypassed.
`<img src=x onerror=alert(1)>` womp womp
# Conflicts:
#	cps/admin.py
#	cps/config_sql.py
#	cps/kobo.py
#	cps/templates/config_edit.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants