Skip to content

fix: remove style-src 'unsafe-inline' from CSP (only needed for Skeleton's inline styles) - #1242

Open
wendyamoni-creator wants to merge 2 commits into
solutions-plug:mainfrom
wendyamoni-creator:fix/style-src-unsafe-inline-in-csp-is-only-needed-for-skeleton
Open

fix: remove style-src 'unsafe-inline' from CSP (only needed for Skeleton's inline styles)#1242
wendyamoni-creator wants to merge 2 commits into
solutions-plug:mainfrom
wendyamoni-creator:fix/style-src-unsafe-inline-in-csp-is-only-needed-for-skeleton

Conversation

@wendyamoni-creator

Copy link
Copy Markdown

Summary

  • Replace Skeleton's inline styles with CSS utility classes
  • Remove 'unsafe-inline' from style-src in next.config.js and proxy.ts

Test plan

  • [x]

predictiq-frontend@1.0.0 test
jest proxy passes

  • [x]

predictiq-frontend@1.0.0 test
jest passes (208 tests)

  • [x]

predictiq-frontend@1.0.0 build
npm run generate-client && next build

predictiq-frontend@1.0.0 generate-client
openapi-typescript ../services/api/openapi.yaml -o src/lib/api/schema.d.ts

✨ openapi-typescript 7.13.0
🚀 ../services/api/openapi.yaml → src/lib/api/schema.d.ts [86.4ms] passes with zero warnings

Closes #1163

…uccess

request() was invalidating NEWSLETTER/STATISTICS cache tags for any
POST/DELETE that returned HTTP 2xx, without inspecting the parsed
payload's success field. newsletterSubscribe / newsletterUnsubscribe
can return { success: false, message: '...' } with a 200 status, so a
rejected subscription was still busting the statistics cache — causing
an unnecessary refetch and a brief stale flicker for unrelated data.

Fix: in the mutation cache-invalidation block, derive 'succeeded' from
the response body:
  - no success field present → treat as success (non-envelope endpoints)
  - success: true           → invalidate as before
  - success: false          → skip invalidation entirely

Tests added to 'Cache invalidation strategy' suite:
  • success:false 200 response → cache NOT invalidated
  • success:true  200 response → cache IS invalidated
  • no success field present   → cache IS invalidated (non-envelope)

Closes solutions-plug#1162
…ton's inline styles)

Replace Skeleton component's inline style attribute with CSS classes and
CSS utility classes in Statistics.css. Remove 'unsafe-inline' from
style-src in both next.config.js and proxy.ts middleware CSP definitions.

This eliminates the CSS-based data exfiltration risk that 'unsafe-inline'
permits, since only one component (Skeleton.tsx) previously required it.

Co-authored-by: automated
@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

@wendyamoni-creator Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

[Bug] style-src 'unsafe-inline' in CSP is only needed for one component's inline style usage

1 participant