[xiphos-source] [crosswire/xiphos] 5ef0e3: fix: escape special_anchor in HtmlOutput JS string...

Devon Kirk noreply at github.com
Tue Jun 30 16:02:52 EDT 2026


  Branch: refs/heads/master
  Home:   https://github.com/crosswire/xiphos
  Commit: 5ef0e338f1cfabdf7d88f004e8bdde7a93478f8a
      https://github.com/crosswire/xiphos/commit/5ef0e338f1cfabdf7d88f004e8bdde7a93478f8a
  Author: Devon Kirk <67167176+hyder365 at users.noreply.github.com>
  Date:   2026-06-30 (Tue, 30 Jun 2026)

  Changed paths:
    M src/gtk/utilities.c

  Log Message:
  -----------
  fix: escape special_anchor in HtmlOutput JS string literal (#1337)

HtmlOutput() interpolates settings.special_anchor into a JavaScript
string literal via g_strdup_printf("%s") inside a <script> tag.
The value originates from the '#' or '!' fragment of sword:// URLs,
which are constructed from untrusted BibleSync navigation packets
(biblesync_glue.cc:179) and module content hyperlinks
(wk-html.c:96).  A crafted ref containing #";alert(1);}// breaks
out of the JS string and executes arbitrary script in the
JS-enabled WebKit2 view with file:// origin.

Escape the anchor with g_strescape() before interpolation to
neutralize backslash, double-quote, and other JS string literal
metacharacters.

Co-authored-by: Devon Kirk <hyder365 at users.noreply.github.com>



To unsubscribe from these emails, change your notification settings at https://github.com/crosswire/xiphos/settings/notifications


More information about the xiphos-source mailing list