<html><head></head><body>I would like to point out that modules downloaded from a source other than an endorsed repository could contain all kinds of stuff the user might not like. The entire module is suspect. The .conf file is the least of worries.<br><br>I am not concerned about escaping other markup. The official position is that we don't support any other markup beyond HTML &lt;a href...&gt; links. The behavior of including any other markup is undefined and bad practice. I am not concerned with preventing it. Practically though 90% of our frontends use HTML displays for most everything and thus other HTML tags will likely work.<br><br>I don't see the security issue. It's like opening a Word doc attached to an email from a stranger. You are not guaranteed it won't do something unkind. This is why we have endorsed SWORD repositories. To prevent all unkind things from ever happening would be like Word trying to prevent the same. It would occupy man years and never accomplish the goal.<br><br>Thoughts?<br><br>Troy<br><br><div class="gmail_quote">On December 30, 2018 2:57:48 PM MST, "refdoc@gmx.net" &lt;refdoc@gmx.net&gt; wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I think, I must apologise here in that I do not check this particular matter at all in submitted modules. I will try and address this asap. <br><br>If anyone starts to create a tracker issue, I would be grateful for a single issue with a list of modules affected instead of one per module<br><br>Peter<br><br>Sent from my mobile. Please forgive shortness, typos and weird autocorrects.<div class="quote" style="line-height: 1.5"><br><br>-------- Original Message --------<br>Subject: Re: [sword-devel] RTFHTML filter not escaping HTML entities<br>From: David Haslam <dfhdfh@protonmail.com><br>To: SWORD Developers' Collaboration Forum <sword-devel@crosswire.org><br>CC: <br><br><br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">   <div>One potential risk would be from modules manually installed after being downloaded from somewhere we have no connection with.&nbsp;</div><div><br></div><div>For the repositories in our MRL, the risk should be much lower, providing the release procedure includes adequate human inspection of the .conf file.&nbsp;</div><div><br></div><div>David</div><div><br></div><div id="protonmail_mobile_signature_block">Sent from ProtonMail Mobile</div> <div><br></div><div><br></div>On Sun, Dec 30, 2018 at 21:20, DM Smith &lt;<a href="mailto:dmsmith@crosswire.org" class="">dmsmith@crosswire.org</a>&gt; wrote:<blockquote class="protonmail_quote" type="cite">  What is the likelihood/risk of an untrustworthy conf?<br><br>— DM Smith<br>From my phone. Brief. Weird autocorrections.<br><br>On Dec 30, 2018, at 4:14 PM, Jaak Ristioja &lt;jaak@ristioja.ee&gt; wrote:<br><br>&gt;&gt; It looks like BibleTime, too, is guilty of not properly escaping those.<br>&gt;<br>&gt; Actually it seems that the RTFHTML filter in Sword (and Sword++ for that<br>&gt; matter) does not properly escape HTML entities included in the RTF. So<br>&gt; if the RTF includes &lt;b&gt; or any other HTML tags, these are passed on<br>&gt; unmodified, wherease they should instead be escaped using &amp;lt;, &amp;gt; and<br>&gt; similar entities. This could allow arbitrary HTML injection from the RTF.<br>&gt;<br>&gt; J<br>&gt;<br>&gt;<br>&gt;<br>&gt;&gt; On 30.12.18 23:03, Jaak Ristioja wrote:<br>&gt;&gt; Btw, grepping my ~/.sword/mods.d/*.conf shows that &lt;a&gt; tags are used<br>&gt;&gt; elsewhere as well, e.g. in About= and DistributionNotes=. There are even<br>&gt;&gt; some &lt;b&gt;, &lt;i&gt; and &lt;u&gt; tags in About= and History_x.x= entries.<br>&gt;&gt;<br>&gt;&gt; It looks like BibleTime, too, is guilty of not properly escaping those.<br>&gt;&gt;<br>&gt;&gt; J<br>&gt;&gt;<br>&gt;&gt;&gt; On 30.12.18 10:32, David Haslam wrote:<br>&gt;&gt;&gt; Wouldn’t the points about HTML apply just as equally to the existing ShortPromo key ?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Some front-ends already jump to the URL specified in the href, and can open a browser to do so.<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; David<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Sent from ProtonMail Mobile<br>&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; On Sun, Dec 30, 2018 at 00:39, Jaak Ristioja &lt;jaak@ristioja.ee&gt; wrote:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; I like the idea, because it is useful information for the users. Here<br>&gt;&gt;&gt;&gt; are some of the thoughts I gathered for this:<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; &lt;brainstorm xmlns="https://en.wikipedia.org/wiki/Brainstorming"&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Why can't the About= entry contain this information?<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; I'm unsure whether "UnlockInfo" is the best name.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Is it safe to assume that this entry will only be relevant for modules<br>&gt;&gt;&gt;&gt; with a CipherKey= entry?<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Using HTML might be a can of worms:<br>&gt;&gt;&gt;&gt; * What version of HTML is permitted?<br>&gt;&gt;&gt;&gt; * How do we ensure future-compatibility?<br>&gt;&gt;&gt;&gt; * If the contents for the UnlockInfo field are to contain a segment of<br>&gt;&gt;&gt;&gt; HTML (and not a whole HTML document), what is the content model?<br>&gt;&gt;&gt;&gt; * For example, would it be safe to embed the contents of the<br>&gt;&gt;&gt;&gt; UnlockInfo field directly inside a &lt;td&gt; element or should it be a &lt;p&gt;?<br>&gt;&gt;&gt;&gt; * Can UnlockInfo= contain<br>&gt;&gt;&gt;&gt; &lt;img&gt;/&lt;audio&gt;/&lt;video&gt;/&lt;object&gt;/&lt;embed&gt;/&lt;script&gt; etc elements?<br>&gt;&gt;&gt;&gt; * How about attributes, e.g. &lt;strong<br>&gt;&gt;&gt;&gt; style='background:url("http://track.me/I_consent")'&gt; or &lt;span<br>&gt;&gt;&gt;&gt; onClick="doBadStuff()"&gt;?<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Modules can originate from untrusted sources. I think it might be a bit<br>&gt;&gt;&gt;&gt; too much to assume that all frontends can properly sanitize the HTML<br>&gt;&gt;&gt;&gt; value, unless we only allow a very restricted subset of the HTML syntax,<br>&gt;&gt;&gt;&gt; e.g. only plain text, HTML entities and &lt;a&gt; elements only one allowed<br>&gt;&gt;&gt;&gt; and mandatory href attribute. Note that &lt;b&gt; and &lt;i&gt; etc are discouraged<br>&gt;&gt;&gt;&gt; in HTML5, &lt;u&gt; was completely redefined. Will &lt;a&gt; ("anchor") still be<br>&gt;&gt;&gt;&gt; valid in HTML6 or will &lt;link&gt; be repurposed for hyperlinks as well?<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Hence I suggest to use a simple URL (or URI, RFC 3986) instead of HTML.<br>&gt;&gt;&gt;&gt; Simple documents (including HTML pages, PDF or any other types of files)<br>&gt;&gt;&gt;&gt; could be embedded using the data: URI scheme (RFC 2397). Frontends could<br>&gt;&gt;&gt;&gt; pass the URI to the OS/desktop/browser to be opened or attempt to<br>&gt;&gt;&gt;&gt; display the information inline (e.g. show a web view widget for<br>&gt;&gt;&gt;&gt; HTTP/HTTPS URIs or similar). Optionally, frontends can display a<br>&gt;&gt;&gt;&gt; warning/confirmation dialog to the user before opening the URI.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Perhaps it would be wiser to have two fields: one for the URI and<br>&gt;&gt;&gt;&gt; another for plain text? I currently have no suggestions for the exact<br>&gt;&gt;&gt;&gt; semantics of naming of such entries, but both of these could be<br>&gt;&gt;&gt;&gt; displayed by frontends. The plain text could be a description of the<br>&gt;&gt;&gt;&gt; URI, or contain full information about obtaining the key. One or both of<br>&gt;&gt;&gt;&gt; the entries could be optional. Frontends could opt to detect URLs in the<br>&gt;&gt;&gt;&gt; plain text as well and render these as hyperlinks.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; Or perhaps we should use a subset of markdown or similar instead?<br>&gt;&gt;&gt;&gt; However, other markup languages could suffer from problems similar to HTML.<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; &lt;/brainstorm&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; J<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; On 30.12.18 00:02, Troy A. Griffitts wrote:<br>&gt;&gt;&gt;&gt;&gt; Dear Frontend Developers,<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; In an effort to gain more publishers-- even those who desire to lock and<br>&gt;&gt;&gt;&gt;&gt; sell some of their modules, I would like to add a new .conf entry:<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; UnlockInfo<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; Up until now, we've relied on the About entry containing something that<br>&gt;&gt;&gt;&gt;&gt; lets the user know how to obtain unlock codes from publishers selling<br>&gt;&gt;&gt;&gt;&gt; codes to unlock their modules.  This entry would isolate just those<br>&gt;&gt;&gt;&gt;&gt; instructions to a specific entry and would allow a frontend to do<br>&gt;&gt;&gt;&gt;&gt; something like:<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; If (moduleToInstall.getConfEntry("UnlockInfo")) {<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;  showDialog("&lt;p&gt;The publisher of this modules requires for you to<br>&gt;&gt;&gt;&gt;&gt; obtain an unlock code.  This code can be entered below, instructions<br>&gt;&gt;&gt;&gt;&gt; from the publisher are as follows:&lt;/p&gt;" +<br>&gt;&gt;&gt;&gt;&gt; moduleToInstall.getConfEntry("UnlockInfo"));<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; }<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; Like many of our entries, this new UnlockInfo entry will allow HTML<br>&gt;&gt;&gt;&gt;&gt; links and will likely contain a direct link from the publisher to their<br>&gt;&gt;&gt;&gt;&gt; store entry to purchase an unlock code.<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; An example would be something like:<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; UnlockInfo=An unlock code for the Larry Fitzgerald NFL HOF Edition of<br>&gt;&gt;&gt;&gt;&gt; the New Testament, with memorable career moments encouraging the<br>&gt;&gt;&gt;&gt;&gt; believer to press on when those around fall short, may be obtained<br>&gt;&gt;&gt;&gt;&gt; directly from the NFL store here: &lt;a target="_blank"<br>&gt;&gt;&gt;&gt;&gt; href="https://nfl.com/shop/lf-nfl-hof-nt-sword-module"&gt;Larry Fitzgerald<br>&gt;&gt;&gt;&gt;&gt; NFL HOF Edition of the New Testament - SWORD Module&lt;/a&gt;<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; Let me know if you have any comments or ideas,<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; Troy<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt;&gt;&gt; sword-devel mailing list: sword-devel@crosswire.org<br>&gt;&gt;&gt;&gt;&gt; http://www.crosswire.org/mailman/listinfo/sword-devel<br>&gt;&gt;&gt;&gt;&gt; Instructions to unsubscribe/change your settings at above page<br>&gt;&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt;&gt; sword-devel mailing list: sword-devel@crosswire.org<br>&gt;&gt;&gt;&gt; http://www.crosswire.org/mailman/listinfo/sword-devel<br>&gt;&gt;&gt;&gt; Instructions to unsubscribe/change your settings at above page<br>&gt;&gt;&gt;&gt;<br>&gt;&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt;&gt; sword-devel mailing list: sword-devel@crosswire.org<br>&gt;&gt;&gt;&gt; http://www.crosswire.org/mailman/listinfo/sword-devel<br>&gt;&gt;&gt;&gt; Instructions to unsubscribe/change your settings at above page<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; sword-devel mailing list: sword-devel@crosswire.org<br>&gt;&gt; http://www.crosswire.org/mailman/listinfo/sword-devel<br>&gt;&gt; Instructions to unsubscribe/change your settings at above page<br>&gt;&gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; sword-devel mailing list: sword-devel@crosswire.org<br>&gt; http://www.crosswire.org/mailman/listinfo/sword-devel<br>&gt; Instructions to unsubscribe/change your settings at above page<br><br>_______________________________________________<br>sword-devel mailing list: sword-devel@crosswire.org<br>http://www.crosswire.org/mailman/listinfo/sword-devel<br>Instructions to unsubscribe/change your settings at above page</blockquote><div><br></div><div><br></div></blockquote></sword-devel@crosswire.org></dfhdfh@protonmail.com></div></blockquote></div><br>-- <br>Sent from my Android device with K-9 Mail. Please excuse my brevity.</body></html>