Skip to content

Content Security Policy violations due to needing unsafe-eval for dbr-8.6.3.wasm.js #102

@bbakerati

Description

@bbakerati

I am using dynamsoft-barcode-reader @8.6.3 in a web application built with React. We recently had a security audit of the application that recommended adding a stricter Content Security Policy. Due to the use of the eval function in the wasm.js file, we are unable to remove unsafe-eval from our content security policy, which the audit recommends.

Do you have a way to avoid using the wasm.js script altogether, or do you have future plans to remove the use of eval in these JavaScript files?

Here is the line where the import failure occurs when unsafe-eval is not part of the Content Security Policy:
image

https://github.com/Dynamsoft/javascript-barcode/blob/3f4fc90c722d324b4aa453c13d7e60bb12a25eed/dist/dbr-8.6.3.worker.js#L25

3 uses of eval in dbr-8.6.3.wasm.js:
https://github.com/Dynamsoft/javascript-barcode/blob/3f4fc90c722d324b4aa453c13d7e60bb12a25eed/dist/dbr-8.6.3.wasm.js#L78
https://github.com/Dynamsoft/javascript-barcode/blob/3f4fc90c722d324b4aa453c13d7e60bb12a25eed/dist/dbr-8.6.3.wasm.js#L120

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions