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

Fixing the server URL path for OpenAPI scanning #5504

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

trypa11
Copy link
Contributor

@trypa11 trypa11 commented Aug 9, 2024

Proposed changes

Issue #5503

I discovered in the debug mode of VS Code that a command in the generator.go file of nuclei incorrectly changes the path, resulting in wrong HTTP requests.

Before the command in line 254 :
image
After the command in line 254:
image

Result after the solution:
image

Checklist

  • [x ] Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@trypa11 trypa11 changed the title Fix ServerUrl path of OpenAPI scanning Fixing the server URL path for OpenAPI scanning Aug 9, 2024
@ehsandeep ehsandeep requested a review from tarunKoyalwar August 9, 2024 16:11
@ehsandeep ehsandeep linked an issue Aug 9, 2024 that may be closed by this pull request
@ehsandeep ehsandeep requested review from dwisiswant0 and removed request for tarunKoyalwar August 16, 2024 06:25
@ehsandeep ehsandeep mentioned this pull request Aug 16, 2024
@trypa11
Copy link
Contributor Author

trypa11 commented Aug 16, 2024

I have resolved the unit test error by finding an alternative method to avoid deleting command 254, as this command is essential for testing. To achieve this, I separated the host and path parts of the server URL and added the server path to the request path.
Additionally, I corrected the swagger file test because it was testing the wrong endpoints.
image
As you can see, the swagger file has an extra /v1 path in every endpoint that is not included in the swagger file's endpoints.

Copy link
Member

@dwisiswant0 dwisiswant0 left a comment

Choose a reason for hiding this comment

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

LGTM.

@ehsandeep ehsandeep merged commit c6e5bdd into projectdiscovery:dev Aug 16, 2024
11 of 12 checks passed
@trypa11 trypa11 deleted the OpenAPI_HTTP_Request branch August 16, 2024 13:39
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.

Wrong URL on the HTTP Request when parsing OpenAPI file
3 participants