Skip to content

Cleanup CSP headers - #117

Open
Elnadrion wants to merge 1 commit into
laminas:3.0.xfrom
Elnadrion:clean-up-csp-headers
Open

Cleanup CSP headers#117
Elnadrion wants to merge 1 commit into
laminas:3.0.xfrom
Elnadrion:clean-up-csp-headers

Conversation

@Elnadrion

Copy link
Copy Markdown
Q A
Documentation no
Bugfix yes
BC Break yes
New Feature no
RFC no
QA no

Description

This change cleans up the Content Security Policy header implementation and test suite to strictly follow the current CSP Level 3 specification

Target branch

Due to the BC break (previously accepted directives are now rejected), target the next major branch: 3.0.x.

What changed:

ContentSecurityPolicy

Removed deprecated/obsolete directives from the valid directives list:

ContentSecurityPolicyReportOnly

Defined a dedicated list appropriate for report-only usage, excluding enforcement-only directives (sandbox and upgrade-insecure-requests)

Why this is necessary:

  • The library should reflect the current CSP3 spec and not accept obsolete directives. Accepting them may give a false sense of protection or produce non-spec headers
  • Report-only header should only include directives that make sense in report-only mode

Signed-off-by: Elnadrion <elnadrion.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant