In our app code we allow some objects to drag and drop around the page. Also we have things like popups that need to be positioned below buttons and dialogs that we position in the page ect.
To do so we need to allow the following inline css properties
- z-index
- top, bottom, left, right
- height, width
We cant really make classes for this, imagine left for example could be 0 to 20000 so we would need millions of classes.
I cant see any way other than inline css.
So to solve for CSP (https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) then that means we need to fully allow style-src: unsafe-inline
I'm sure this is a common scenario. What do people do about this case? We also use veracode to scan our software so im thinking we just "mitagate" this by explaining that we only allow a set of inline css attributes.
But i would think maybe CSP should allow a certain subset of dynamic css attributes.
Has anyone encountered this and have any thoughts?