-
Notifications
You must be signed in to change notification settings - Fork 5k
CSP errors caused by Drawer #18910
Copy link
Copy link
Closed
Labels
Resolution: StaleIssue or pull request is inactivity and unfortunately it will be *closed* if there is no responseIssue or pull request is inactivity and unfortunately it will be *closed* if there is no responseStatus: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possibleIssue will be reviewed by Core Team and a relevant label will be added as soon as possible
Milestone
Metadata
Metadata
Assignees
Labels
Resolution: StaleIssue or pull request is inactivity and unfortunately it will be *closed* if there is no responseIssue or pull request is inactivity and unfortunately it will be *closed* if there is no responseStatus: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possibleIssue will be reviewed by Core Team and a relevant label will be added as soon as possible
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
Done
Describe the bug
Drawer component causes CSP violations with a strict CSP policy on style-src-attr.
This is caused due to the component using the setAttribute function from primeuix to set styling.
This is done at the lines:
primeng/packages/primeng/src/drawer/drawer.ts
Line 393 in 1d97c85
primeng/packages/primeng/src/drawer/drawer.ts
Line 394 in 1d97c85
Example of valid/invalid usage
There don't seem to be any other usages in the project that use
setAttributeto influence styling.Pull Request Link
No response
Reason for not contributing a PR
Other Reason
I'm not sure if you prefer to change the inner working of
primeuixsetAttributeto detect styling usage or wether you just want to change these two invocations.Reproducer
https://stackblitz.com/edit/github-l9aakal4?file=src%2Findex.html
Environment
Angular version
20
PrimeNG version
v20
Node version
24.4.1
Browser(s)
Edge 140
Steps to reproduce the behavior
style-src-attr 'self'to CSP policy. (meta tag or header)Expected behavior
Component shouldn't cause CSP errors.