title: Unsafe object binding checkmarx spring boot application
body: <p>I'm getting this alert from checkmarx, saying that i have an unsafe object binding when trying to save a comment.
  I've read that we mustn't save objects directly from the requestBody as it can be dangerous, that's why i'm getting a commentDTO from the client, create a new comment from the dto using modelMapper, and create the comment in the commentService and save it to the database, but checkmarx keeps pointing to the same issue.</p>
  <p>this is my contoller:</p>
  <pre><code>@PostMapping(&quot;/add&quot;)
      public ResponseEntity&lt;Comment&gt; createFaq(@RequestBody  CommentDTO commentDTO) {
          try {
              
              Comment comment = new Comment();
              modelMapper.getConfiguration()
              .setMatchingStrategy(MatchingStrategies.LOOSE);
              modelMapper.getConfiguration().setAmbiguityIgnored(true);
              
              comment = modelMapper.map(commentDTO, Comment.class);
  
              commentservice.create(comment);
              return new ResponseEntity&lt;&gt;( HttpStatus.CREATED);
          } catch (Exception e) {
              System.out.println(&quot;unable to create comment with msg &quot;+e.getMessage());
              return new ResponseEntity&lt;&gt;(null, HttpStatus.INTERNAL_SERVER_ERROR);
          }
      }
  </code></pre>
  <p>this is my dto :</p>
  <pre><code>@Data
  public class CommentDTO {
      private Long id_comment;
      private String contenue;
      private Employe employe;
      private Faq faq;
      private Notifications notif;
      private LocalDateTime dateOfComment = LocalDateTime.now();
  }
  </code></pre>