Details

    • Type: Language-Specification
    • Status: Active
    • Resolution: Unresolved
    • Labels:
      None
    • Impact:
      Unknown 'null' severity
    • Likelihood:
      Unknown 'null' severity
    • Default Quality Profiles:
      Sonar way, Sonar way recommended

      Description

      Sensitive Code Example

      // === Built-in NodeJS modules ===
      const http = require('http');
      http.request(url, (res) => {}); // Sensitive
      http.get(url, (res) => {}); // Sensitive
      
      const https = require('https');
      https.request(url, (res) => {}); // Sensitive
      https.get(url, (res) => {}); // Sensitive
      
      // === Request NodeJS module ===
      const request = require('request');
      // All Request methods making HTTP requests are security-sensitive and should be reviewed.
      // Examples:
      request(url, function (error, res, body) {}); // Sensitive
      request.get(url); // Sensitive
      
      // === Axios module ===
      const axios = require('axios');
      // All Axios methods making HTTP requests are security-sensitive and should be reviewed.
      // Example:
      axios.get(url) // Sensitive
        .then(function (res) {});
      
      // === In browser, XMLHttpRequest ===
      var xmlhttp = null;
      if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest(); // modern browsers
      } else {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // very old IE browsers
      }
      xmlhttp.onreadystatechange = function() {};
      xmlhttp.open("GET", url, false); // Sensitive
      xmlhttp.send();
      
      // === In modern browsers, Fetch API ===
      window.fetch(url) // Sensitive
        .then(function(res) {});
      
      // === In old IE browsers, XDomainRequest ===
      var xdr = new XDomainRequest();
      xdr.open("GET", url);
      xdr.send();
      
      // === In browser, jQuery ===
      // All jQuery methods making HTTP requests are security-sensitive and should be reviewed.
      // Examples:
      $.ajax({ url: url }) // Sensitive
        .done(function(data) {});
      $.get(url, function(data) {}); // Sensitive
      

      Sensitive Code Example

      // === NodeJS built-in modules ===
      const http = require('http');
      const https = require('https');
      
      // Endpoints exposed by http.Server and https.Server objects are security-sensitive and should be reviewed.
      // Examples:
      
      const srv = new http.Server((req, res) => {});
      srv.listen(3000); // Sensitive
      
      // http.createServer creates a new http.Server object.
      const srv = http.createServer((req, res) => {});
      srv.listen(3000); // Sensitive
      
      const srv = new https.Server((req, res) => {});
      srv.listen(3000); // Sensitive
      
      // https.createServer creates a new https.Server object.
      const srv = https.createServer((req, res) => {});
      srv.listen(3000); // Sensitive
      
      // === ExpressJS ===
      const express = require('express');
      const app = express();
      
      // Endpoints exposed by ExpressJS are security-sensitive and should be reviewed.
      // Example:
      
      app.get('/', function (req, res) {});
      app.post('/', function (req, res) {});
      app.all('/', function (req, res) {});
      app.listen(3000); // Sensitive
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              lars.svensson Lars Svensson (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: