<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Can a Content Security Policy (CSP) against cross-site scripting (XSS) be implemented at the Cloudron app level?]]></title><description><![CDATA[<ul>
<li><a href="https://developer.chrome.com/docs/lighthouse/best-practices/csp-xss/" target="_blank" rel="noopener noreferrer nofollow ugc">https://developer.chrome.com/docs/lighthouse/best-practices/csp-xss/</a></li>
<li><a href="https://web.dev/strict-csp/" target="_blank" rel="noopener noreferrer nofollow ugc">https://web.dev/strict-csp/</a></li>
</ul>
<p dir="auto">Can a Content Security Policy (CSP) against cross-site scripting (XSS) be implemented at the Cloudron app level?</p>
<p dir="auto">Perhaps as an option, in case it were to break anything for anyone using plugins and scripts that don't respect this.</p>
<p dir="auto">Also helps in Google Pagespeed results and ranking:</p>
<ul>
<li><a href="https://pagespeed.web.dev/" target="_blank" rel="noopener noreferrer nofollow ugc">https://pagespeed.web.dev/</a></li>
</ul>
<p dir="auto"><img src="/assets/uploads/files/1693153918006-e048cc87-c980-4808-b3ef-dff0238e6808-image-resized.png" alt="e048cc87-c980-4808-b3ef-dff0238e6808-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.cloudron.io/topic/9892/can-a-content-security-policy-csp-against-cross-site-scripting-xss-be-implemented-at-the-cloudron-app-level</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 21:04:13 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/9892.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 27 Aug 2023 16:38:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can a Content Security Policy (CSP) against cross-site scripting (XSS) be implemented at the Cloudron app level? on Mon, 28 Aug 2023 21:17:34 GMT]]></title><description><![CDATA[<p dir="auto">Yeah, deep in the rabbit hold on research on this. There's nothing that distracts me more than something that has a score attached to it <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f602.png?v=223f9defb2f" class="not-responsive emoji emoji-android emoji--joy" style="height:23px;width:auto;vertical-align:middle" title=":joy:" alt="😂" />  (not competitive all all <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=223f9defb2f" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /> )</p>
<p dir="auto">Trying to get a clean sheet of green on this:</p>
<ul>
<li><a href="https://inspectwp.com" target="_blank" rel="noopener noreferrer nofollow ugc">https://inspectwp.com</a></li>
</ul>
<p dir="auto">Given WordPress is perhaps the most popular self-hosted app of all, be great to have the Cloudron setup as perfect as possible, particularly for WordPress. So many more expensive options out there charging per site. Lots of wins possible from being able to proclaim the best WP setup possible <img src="https://forum.cloudron.io/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=223f9defb2f" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:23px;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://forum.cloudron.io/post/72600</link><guid isPermaLink="true">https://forum.cloudron.io/post/72600</guid><dc:creator><![CDATA[marcusquinn]]></dc:creator><pubDate>Mon, 28 Aug 2023 21:17:34 GMT</pubDate></item><item><title><![CDATA[Reply to Can a Content Security Policy (CSP) against cross-site scripting (XSS) be implemented at the Cloudron app level? on Mon, 28 Aug 2023 02:30:26 GMT]]></title><description><![CDATA[<p dir="auto">The 2nd link suggests one of two options:</p>
<h3>Step 1: <a href="https://web.dev/strict-csp/#step-1-decide-if-you-need-a-nonce-or-hash-based-csp" target="_blank" rel="noopener noreferrer nofollow ugc">Decide if you need a nonce- or hash-based CSP</a></h3>
<p dir="auto">There are two types of strict CSPs, nonce- and hash-based. Here's how they work:</p>
<ul>
<li><strong>Nonce-based CSP</strong>: You generate a random number <em>at runtime</em>, include it in your CSP, and associate it with every script tag in your page. An attacker can't include and run a malicious script in your page, because they would need to guess the correct random number for that script. This only works if the number is not guessable and newly generated at runtime for every response.</li>
<li><strong>Hash-based CSP</strong>: The hash of every inline script tag is added to the CSP. Note that each script has a different hash. An attacker can't include and run a malicious script in your page, because the hash of that script would need to be present in your CSP.</li>
</ul>
<p dir="auto">Criteria for choosing a strict CSP approach:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Nonce-based CSP</th>
<th>For HTML pages rendered on the server where you can create a new random token (nonce) for every response.</th>
</tr>
</thead>
<tbody>
<tr>
<td>Hash-based CSP</td>
<td>For HTML pages served statically or those that need to be cached. For example, single-page web applications built with frameworks such as Angular, React or others, that are statically served without server-side rendering.</td>
</tr>
</tbody>
</table>
]]></description><link>https://forum.cloudron.io/post/72522</link><guid isPermaLink="true">https://forum.cloudron.io/post/72522</guid><dc:creator><![CDATA[robi]]></dc:creator><pubDate>Mon, 28 Aug 2023 02:30:26 GMT</pubDate></item><item><title><![CDATA[Reply to Can a Content Security Policy (CSP) against cross-site scripting (XSS) be implemented at the Cloudron app level? on Mon, 28 Aug 2023 02:22:41 GMT]]></title><description><![CDATA[<p dir="auto">We already set some headers following the <a href="https://infosec.mozilla.org/guidelines/web_security" target="_blank" rel="noopener noreferrer nofollow ugc">Mozilla recommendations</a>, <a href="https://owasp.org/www-project-secure-headers/#tab=Compatibility_Matrix" target="_blank" rel="noopener noreferrer nofollow ugc">OWASP</a> and <a href="https://github.com/github/secure_headers:" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/github/secure_headers:</a></p>
<pre><code>map $upstream_http_referrer_policy $hrp {
    default $upstream_http_referrer_policy;
    "" "same-origin";
}
...

    add_header X-XSS-Protection "1; mode=block";
    proxy_hide_header X-XSS-Protection;
    add_header X-Download-Options "noopen";
    proxy_hide_header X-Download-Options;
    add_header X-Content-Type-Options "nosniff";
    proxy_hide_header X-Content-Type-Options;
    add_header X-Permitted-Cross-Domain-Policies "none";
    proxy_hide_header X-Permitted-Cross-Domain-Policies;

    # See header handling from upstream on top of this file
    add_header Referrer-Policy $hrp;
    proxy_hide_header Referrer-Policy;
</code></pre>
]]></description><link>https://forum.cloudron.io/post/72521</link><guid isPermaLink="true">https://forum.cloudron.io/post/72521</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Mon, 28 Aug 2023 02:22:41 GMT</pubDate></item><item><title><![CDATA[Reply to Can a Content Security Policy (CSP) against cross-site scripting (XSS) be implemented at the Cloudron app level? on Mon, 28 Aug 2023 02:20:08 GMT]]></title><description><![CDATA[<p dir="auto">CSP directives are meant for the browser. They include things like where to load images from, what scripts can be executed, is embedding allowed etc. This necessarily means that the CSP can only be defined by the author of the HTML which in Cloudron's case is the app itself. Only the app author knows the kind of content in the HTML.</p>
<p dir="auto">So, yeah, afaik, it's not possible to put something generic that works across apps.</p>
]]></description><link>https://forum.cloudron.io/post/72520</link><guid isPermaLink="true">https://forum.cloudron.io/post/72520</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Mon, 28 Aug 2023 02:20:08 GMT</pubDate></item></channel></rss>