flatpressblog / flatpress

FlatPress is a lightweight, easy-to-set-up flat-file blogging engine.
https://flatpress.org
GNU General Public License v2.0
187 stars 57 forks source link

Removes inline-unsave code | Solves #422 #423

Closed Fraenkiman closed 5 months ago

Fraenkiman commented 5 months ago

Description Scripts are integrated with a nonce (<script nonce=“rAnd0m”....). The hexadecimal value is changed each time the page is called. The variable is located in the array $fp_config ['plugins'] ['fpprotect'] ['random_hex'] and can be included in templates with {$fp_config.plugins.fpprotect.random_hex}.

If required, this nonce can be pushed into the HTML response header as a directive via the FPProtect plugin. The client browser then checks whether a nonce value is stored in the script directive and waves all scripts with the same nonce through as safe.

Note To enable the FlatPress admin to migrate their own plugins and templates, the self inline-unsave https: script directive is still active. I recommend completing the migration promptly and activating the default secure script directive to prevent XSS attacks on vulnerabilities in the scripts.