-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
OpenCV.js Security Issue #3159
Comments
@bsekachev , do you think we can find an alternative way to load OpenCV dynamically? |
There are three ways to upload script dynamically:
What is more, we already use |
Serving over HTTPS section of the installation manual during v1.2.0 included Content-Security-Policy header without unsafe-eval in nginx conf. |
I could not figure out how to properly configure NGINX to make Chromium happily load opencv.js, so I had to disable https. |
We were having problems with CSP while loading opencv.js. A quick look revealed that opencv.js is loaded with an unsafe eval, and the ESLint error is suppressed in the code, as seen below:
https://github.com/openvinotoolkit/cvat/blob/df175a856179f1c31ac2b15c80d98986a3d35acf/cvat-ui/src/utils/opencv-wrapper/opencv-wrapper.ts#L63-L65
So loading the script is blocked in the browser due to the unsafe eval.
We wonder why loading opencv.js is implemented this way. I'm not a frontend engineer, but all resources say the same thing: this is a terrible practice, eval is evil, it should not be used, and there is no reason to use it.
The text was updated successfully, but these errors were encountered: