owasp-noir / noir

Attack surface detector that identifies endpoints by static analysis
https://owasp.org/www-project-noir/
MIT License
607 stars 45 forks source link

Fix: Improve Java lexer and endpoint parsing to resolve crashes and newline issues #455

Closed ksg97031 closed 2 weeks ago

ksg97031 commented 2 weeks ago

Description

This PR addresses two critical issues identified during testing and development:

  1. Handling Empty URLs in Endpoint Parsing

    • Fixed an issue where endpoints with empty URLs were generated, causing crashes during runtime.
    • Added validation to ensure that empty URL strings are properly handled.
  2. Improving Java Lexer for Newline Sanitization

    • Resolved a parsing issue where comments between class declarations and RequestMapping annotations were improperly sanitized along with newlines.
    • Adjusted the lexer to correctly process comments and newlines without affecting subsequent mappings.

These changes improve the stability and reliability of endpoint parsing and Java annotation handling in the application.

Changes

Testing