-
Notifications
You must be signed in to change notification settings - Fork 69
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
AJV schema validation functions should be pre-compiled to avoid unsafe-eval CSP requirement #423
Comments
@hrobertson thanks for reporting this. See also: https://github.com/ajv-validator/ajv/blob/master/docs/standalone.md |
This issue is stale because it has been open 30 days with no activity. |
I have been working on this, but am awaiting some response from the ajv team ajv-validator/ajv#1837 |
This issue is stale because it has been open 30 days with no activity. |
This commit modifies the build pipleline so that the cloudevent schema is precompiled for runtime validation. This eliminates the need to compile the schema at runtime, improving both performance and security. Fixes: cloudevents#423 Signed-off-by: Lance Ball <lball@redhat.com>
This commit modifies the build pipleline so that the cloudevent schema is precompiled for runtime validation. This eliminates the need to compile the schema at runtime, improving both performance and security. Fixes: cloudevents#423 Signed-off-by: Lance Ball <lball@redhat.com>
This issue is stale because it has been open 30 days with no activity. |
* feat: precompile cloudevent schema This commit modifies the build pipleline so that the cloudevent schema is precompiled for runtime validation. This eliminates the need to compile the schema at runtime, improving both performance and security. Fixes: #423 Signed-off-by: Lance Ball <lball@redhat.com>
Describe the Bug
Compiling the AJV schema validation functions at runtime uses new
new Function
which requires the CSPscript-src
to include'unsafe-eval'
.Instead, the schema validation functions should be pre-compiled.
Steps to Reproduce
script-src
not including'unsafe-eval'
new CloudEvent(...)
Expected Behavior
The library should be able to be used successfully without including
'unsafe-eval'
in your CSP.Additional context
See https://github.com/ajv-validator/ajv/blob/master/docs/security.md#content-security-policy
The text was updated successfully, but these errors were encountered: