Details

    • Type: Language-Specification
    • Status: Active
    • Resolution: Unresolved
    • Labels:
      None
    • Highlighting:
      Hide

      The method annotated with @RequestMapping

      Show
      The method annotated with @RequestMapping
    • Impact:
      Unknown 'null' severity
    • Likelihood:
      Unknown 'null' severity

      Description

      Exposing HTTP endpoints is security-sensitive. It has led in the past to the following vulnerabilities:

      HTTP endpoints are webservices' main entrypoint. Attackers will take advantage of any vulnerability by sending crafted inputs for headers (including cookies), body and URI. No input should be trusted and extreme care should be taken with all returned value (header, body and status code).

      This rule flags code which creates HTTP endpoint. It guides security code reviews to security-sensitive code.
      In the case of the Spring framework, methods of a @Controller object annotated with @RequestMapping (or all its variants such as @GetMapping, @PostMapping, @PutMapping, @PatchMapping and @DeleteMapping) are declaring HTTP endpoints.

      Noncompliant Code Example

      @RequestMapping(path = "/profile", method = RequestMethod.GET) // Noncompliant
      public UserProfile getUserProfile(String name) {
      ...
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nicolas.harraudeau Nicolas Harraudeau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: