Skip to content
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

Fix: Validate properties are URIs and set content-type #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

byron-okta
Copy link

No description provided.

Comment on lines +56 to +59
authorization_endpoint: { type: "string", format: "uri" },
token_endpoint: { type: "string", format: "uri" },
userinfo_endpoint: { type: "string", format: "uri" },
jwks_uri: { type: "string", format: "uri" },
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DanOnCall here we can specify the format of the string. If is not a valid URI, the validation will thrown an error 👍

index.js Outdated
if (isJson(body)) {
const isValid = valid.validate(JSON.parse(body), discoverySchema);
if (isValid.errors.length < 1) {
res.setHeader("Content-Type", "application/json");
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DanOnCall, I'm setting the content type of the response here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prevents from returning an HTML response that can execute any malicious code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant