title: JSON Injection writes unvalidated input into JSON
body: <p>While scanning the code through fortify tool I am getting the below error:</p>
  
  <p>On line 64 of CaApiService.java, the method initializeBearerAuthorizationValue() writes unvalidated input into JSON. This call could allow an attacker to inject arbitrary elements or attributes into the JSON entity.</p>
  
  <pre><code>void initializeBearerAuthorizationValue() throws URISyntaxException, BackendException, IOException, ConversionException {
      // Request to CA for Security Token
      CloseableHttpResponse response = requestAuthenticationToken();
  
      if(response.getStatusLine().getStatusCode()  != 200) {
          LOGGER.info(IOUtils.toString(response.getEntity().getContent()));
          throw new BackendException("CaTechnologies configuration is not configured correctly");
      }
  
      // Parse response and return Bearer string to be used in all subsequent requests
      String theString = IOUtils.toString(response.getEntity().getContent());
      ObjectMapper mapper = new ObjectMapper();
      Map map = mapper.readValue(theString, Map.class);
  
      bearerAuthorizationValue = "Bearer " + Base64.encodeBase64String(String.format("{\"tkn\":\"%s\",\"all\":true}",
              map.get("tkn")).getBytes());
  }
  </code></pre>
  
  <p>Any suggestions?</p>