Skip to content

Declare the Classic theme's CSP needs in theme.yml - #247

Open
pavelnovitsky wants to merge 1 commit into
PrestaShop:developfrom
pavelnovitsky:feature/csp
Open

pavelnovitsky wants to merge 1 commit into
PrestaShop:developfrom
pavelnovitsky:feature/csp

Conversation

@pavelnovitsky

Copy link
Copy Markdown

Companion to the core Security headers (CSP) feature — PrestaShop/PrestaShop#43192 (base develop).

Adds global_settings.csp: script-src 'unsafe-eval' to config/theme.yml. Under an enforced CSP, Classic's Bootstrap 4.0.0-alpha.5 Util.reflow() calls new Function(), which script-src blocks without 'unsafe-eval' (the add-to-cart modal throws a CSP EvalError). This is a hard requirement a merchant cannot curate away from the violation log, so the theme declares it.

Must merge before merchants enforce CSP on the Classic theme. The default theme (Hummingbird, modern Bootstrap, no new Function()) needs no entry. Base branch: develop.

Bootstrap 4.0.0-alpha.5 Util.reflow() calls new Function() on every
transition (modals, collapse, carousel, tooltips), so Classic needs
script-src 'unsafe-eval' or those components break under CSP enforcement.
Themes cannot register hooks, so the theme declares the need under
global_settings.csp, which core's CspPolicyProvider merges additively.

Companion to the native CSP feature in PrestaShop/PrestaShop.
@ps-jarvis

Copy link
Copy Markdown

Hello @pavelnovitsky!

This is your first pull request on classic-theme repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants