New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Angular dev mode errors with a strict CSP without unsafe-eval #43494
Milestone
Comments
5 tasks
JoostK
added a commit
to JoostK/angular
that referenced
this issue
Sep 25, 2021
…oid CSP violations This commit removes the dynamic creation of named arrays for internal runtime storage arrays as they may cause CSP violations in development mode, when an application's CSP configuration does not include `unsafe-eval`. Named arrays for view data can still be enabled in development mode using the `ngDevMode=namedConstructors` query parameter when loading the application. The usage of native class syntax for named arrays does not have the desired effect when the code is downleveled to ES5. Since ES5 targets are becoming increasingly more rare this is not considered less of a problem that the CSP violation. Fixes angular#43494
JoostK
added a commit
to JoostK/angular
that referenced
this issue
Sep 25, 2021
…oid CSP violations This commit removes the dynamic creation of named arrays for internal runtime storage arrays as they may cause CSP violations in development mode, when an application's CSP configuration does not include `unsafe-eval`. Named arrays for view data can still be enabled in development mode using the `ngDevMode=namedConstructors` query parameter when loading the application. The usage of native class syntax for named arrays does not have the desired effect when the code is downleveled to ES5. Since ES5 targets are becoming increasingly more rare this is not considered less of a problem that the CSP violation. Fixes angular#43494
JoostK
added a commit
to JoostK/angular
that referenced
this issue
Sep 25, 2021
…oid CSP violations This commit removes the dynamic creation of named arrays for internal runtime storage arrays as they may cause CSP violations in development mode, when an application's CSP configuration does not include `unsafe-eval`. Named arrays for view data can still be enabled in development mode using the `ngDevMode=namedConstructors` query parameter when loading the application. The usage of native class syntax for named arrays does not have the desired effect when the code is downleveled to ES5. Since ES5 targets are becoming increasingly more rare this is not considered less of a problem that the CSP violation. Fixes angular#43494
JoostK
added a commit
to JoostK/angular
that referenced
this issue
Sep 25, 2021
…oid CSP violations This commit removes the dynamic creation of named arrays for internal runtime storage arrays as they may cause CSP violations in development mode, when an application's CSP configuration does not include `unsafe-eval`. Named arrays for view data can still be enabled in development mode using the `ngDevMode=namedConstructors` query parameter when loading the application. The usage of native class syntax for named arrays does not have the desired effect when the code is downleveled to ES5. Since ES5 targets are becoming increasingly more rare this is considered less of a problem than the CSP violation. Fixes angular#43494
JoostK
added a commit
to JoostK/angular
that referenced
this issue
Oct 30, 2021
…oid CSP violations This commit removes the dynamic creation of named arrays for internal runtime storage arrays as they may cause CSP violations in development mode, when an application's CSP configuration does not include `unsafe-eval`. Named arrays for view data can still be enabled in development mode using the `ngDevMode=namedConstructors` query parameter when loading the application. The usage of native class syntax for named arrays does not have the desired effect when the code is downleveled to ES5. Since ES5 targets are becoming increasingly more rare this is considered less of a problem than the CSP violation. Fixes angular#43494
atscott
added a commit
that referenced
this issue
Nov 9, 2021
…oid CSP violations (#43587) This commit removes the dynamic creation of named arrays for internal runtime storage arrays as they may cause CSP violations in development mode, when an application's CSP configuration does not include `unsafe-eval`. Named arrays for view data can still be enabled in development mode using the `ngDevMode=namedConstructors` query parameter when loading the application. The usage of native class syntax for named arrays does not have the desired effect when the code is downleveled to ES5. Since ES5 targets are becoming increasingly more rare this is considered less of a problem than the CSP violation. Fixes #43494 PR Close #43587
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
dimakuba
added a commit
to dimakuba/angular
that referenced
this issue
Dec 28, 2021
…oid CSP violations (angular#43587) This commit removes the dynamic creation of named arrays for internal runtime storage arrays as they may cause CSP violations in development mode, when an application's CSP configuration does not include `unsafe-eval`. Named arrays for view data can still be enabled in development mode using the `ngDevMode=namedConstructors` query parameter when loading the application. The usage of native class syntax for named arrays does not have the desired effect when the code is downleveled to ES5. Since ES5 targets are becoming increasingly more rare this is considered less of a problem than the CSP violation. Fixes angular#43494 PR Close angular#43587
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.


Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
It seems that Angular calls
new Functionandglobal['eval']from within this file when running in dev mode. As a result, the browser throws CSP errors when trying to implement a strict CSP withoutunsafe-eval. Thus we have to choose between keepingunsafe-evalin place vs living with a large number of loud errors in the console while developing locally.To reproduce:
Please provide a link to a minimal reproduction of the bug
https://github.com/pbrowning-tt/unsafe-eval-error-minimal-repro
Please provide the exception or error you saw
Please provide the environment you discovered this bug in
Anything else?
No response
The text was updated successfully, but these errors were encountered: