Skip to content

Conversation

Fdawgs
Copy link
Member

@Fdawgs Fdawgs commented Oct 21, 2023

See fastify/fastify-autoload#330

Checklist

function resolveServerUrls (servers) {
const resolvedUrls = []
const findVariablesRegex = /{(.*?)}/g // As for OpenAPI v3 spec url variables are named in brackets, e.g. {foo}
const findVariablesRegex = /\{(.*?)\}/gu // As for OpenAPI v3 spec url variables are named in brackets, e.g. {foo}
Copy link
Member

Choose a reason for hiding this comment

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

Was the escape necessary?

Just curious

Copy link
Member Author

@Fdawgs Fdawgs Oct 22, 2023

Choose a reason for hiding this comment

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

Without it they are treated as part of a quantifier.

@mcollina
Copy link
Member

@Fdawgs CodeQL is complaining about this regexp, could you take a look?

@Fdawgs Fdawgs changed the title refactor(lib): add u unicode flag to regex fix(lib): polynomial redos route Oct 28, 2023
@Fdawgs
Copy link
Member Author

Fdawgs commented Oct 28, 2023

@Fdawgs CodeQL is complaining about this regexp, could you take a look?

This appears to have been an issue prior to this change (if you look in the Security tab of the repo).

@Fdawgs Fdawgs requested review from gurgunday, a team and mcollina October 28, 2023 11:03
@Fdawgs Fdawgs changed the title fix(lib): polynomial redos route fix(lib): polynomial redos routes Oct 28, 2023
@Fdawgs
Copy link
Member Author

Fdawgs commented Oct 28, 2023

Found another one in 698c66a that CodeQL didn't pick up.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit f62afad into master Oct 28, 2023
@Fdawgs Fdawgs deleted the refactor/regex branch October 28, 2023 14:08
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.

3 participants