{
  "version": 1.1,
  "suite": [
    {
      "type": "SOURCES",
      "description": "Source with sensitive name \"$1\"",
      "parameters": {
        "$1": [
          "access_key_id",
          "accessKeyId",
          "address",
          "apikey",
          "api_key",
          "apiToken",
          "api_token",
          "auth",
          "authentication",
          "authorization",
          "consumerId",
          "consumer_id",
          "consumerKey",
          "consumer_key",
          "consumerSecret",
          "consumer_secret",
          "email",
          "expirationToken",
          "expiration_token",
          "lastname",
          "mail",
          "pass",
          "passwd",
          "password",
          "passPhrase",
          "pass_phrase",
          "private_key",
          "privateKey",
          "publicKey",
          "public_key",
          "pwd",
          "refreshToken",
          "refresh_token",
          "secret",
          "secretAccessKey",
          "secret_access_key",
          "secretKey",
          "secret_key",
          "sign",
          "signature",
          "signed",
          "surname",
          "token",
          "user",
          "username"
        ]
      },
      "input": [
        {
          "origin": "http.request.parameter",
          "name": "$1",
          "value": "table"
        }
      ],
      "expected": [
        {
          "origin": "http.request.parameter",
          "name": "$1",
          "redacted": true
        }
      ]
    },
    {
      "type": "SOURCES",
      "description": "Source with sensitive value \"$1\"",
      "parameters": {
        "$1": [
          "BEARER lwqjedqwdoqwidmoqwndun32i",
          "glpat-xxxxxxxxxxxxxxxxxxxx",
          "-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAkVDOAMenPclQ7z5U3i3QYw4lQuijEyxnEgTXkk88L20moFBU 4vJkSguvUXrGzNiH+WMWWWTAXBTDdtOHApQJSdU0P4lY+0P3Lw3WeZaetPm583ac DlaCk9DaqPQnjpZ/9DLqmx1r5JYAZbCiuXWMA0lzJUOOniwt94BWCnz3+0LbrC7j NsiaC7cRc1kmj/Nmu8ydA4eop44tJMlaXb9nnUIxglUm0yL1NDOTzokTP03Fa7JW t46gMo6co751nYm43MwOb/cY0Uh6+i59czXuCs0hFpWyEkQJDjcQNXgy9ctI0R/J nBbQykSJG8C0cB9nsfwbtuRIQVrgoj65erlXawIDAQABAoIBAByGkTnj93eQilu8 j6phsfOP9k6RHloIMF+AJdUpyrXApoF344H9dSR38L187YOOyfpxshRwS7aHuOsd kPY3my8sNCp4ysfgSqio/b42jAcYsqERWocSAmYD7LiX3SAHeSy1xgoXF3Py4jcU Go1vfsGybHEXNurj304jmkBK0d83rYdYFNa58jY+6fCrt7b7SdxcjImvRbx0ByvB O/igAQxHLYZAVM+9eD8kHRt6nFkdllGkdynMPx82RllpjyZvxBm8hXeRCXvT78Ja 9aOx6YZLND6iLinAh2J+zFKTtl+iX8DD+39DMFEgLjgKJB84phux1h/2PP8RS2tp 5TqWy7ECgYEA+A8HEKKFTaYD4GQaiD+L4gOh2ZcLykdG8IIXRxzCPtv5VWKS2SCz WWyFoVRlV4b6q96PJwdS/6skbbWS98HIg3aqhOVaXyGxZHlzRgopE3OfRiDcf/Xd bO+Y7phH6h+hMBWpAAojJ+lWzGkg2DewCY0NjkUdOrFAZZWWLrQqGGMCgYEAlfe+ S3gXGqVk3ZyS4f8TyWrkKfVaRVa2KT0GGBJ8TNOB7xlf0oVmKCKSGoWbY5znt2e2 OTb6/zL0qzm1R9pNw5tUE5k/cCReZ20TpcHExoc+1prvmoCO8ToYMfGPOTBpRKBo Hdtx4xjBVe9omP6c/U8jfMDUL+cEKgvvjHUXv1kCgYEApTo1RYJLcoYjTOLAvYI+ ZYRv2SSAKPNDME4mvSpNxFr3gEVRdSkP7X+YnvY9LojtDXAIQEHjqgLQF/d69mZw bgir2it+/6DMrRUskDmSVK+OJsMavG0DWV1aq4ppVGxPDF1RHYKjGiGVvEBGLV8i daornlkw9/g64a86ws8kvusCgYBvnRs7//zyD/aqGUYYfUe0uKFnuPueb5LTzl8i u19XrnMeCLyQakhFxrUGmDm2QakTj1TH8GuOU9ZVOXX6LDeERa6lh4D3bZn1T/E3 hKd3OmFCR73cN6IrVxl60lXOMoGmWdwjnJd+dYYu9yfZ9mXRAX1f9AP4Qu+Oe6Ol 3d/2wQKBgQCgdA48bkRGFR/OqcGACNVQFcXQYvSabKOZkg303NH7p4pD8Ng6FDW+ r8r8+M/iMF9q7XvcX5pF8zgGk/MfHOdf9wWv7Uih7CIQzJLEs+OzNqx//Jn1EuV4 GBudByVPLqUDB5nvcDxTTsDP+gPFQtQ1mAWB1r18s9x4OioqvoV/6Q== -----END RSA PRIVATE KEY-----",
          "-----BEGIN OPENSSH PRIVATE KEY----- MIIEpAIBAAKCAQEAkVDOAMenPclQ7z5U3i3QYw4lQuijEyxnEgTXkk88L20moFBU 4vJkSguvUXrGzNiH+WMWWWTAXBTDdtOHApQJSdU0P4lY+0P3Lw3WeZaetPm583ac DlaCk9DaqPQnjpZ/9DLqmx1r5JYAZbCiuXWMA0lzJUOOniwt94BWCnz3+0LbrC7j NsiaC7cRc1kmj/Nmu8ydA4eop44tJMlaXb9nnUIxglUm0yL1NDOTzokTP03Fa7JW t46gMo6co751nYm43MwOb/cY0Uh6+i59czXuCs0hFpWyEkQJDjcQNXgy9ctI0R/J nBbQykSJG8C0cB9nsfwbtuRIQVrgoj65erlXawIDAQABAoIBAByGkTnj93eQilu8 j6phsfOP9k6RHloIMF+AJdUpyrXApoF344H9dSR38L187YOOyfpxshRwS7aHuOsd kPY3my8sNCp4ysfgSqio/b42jAcYsqERWocSAmYD7LiX3SAHeSy1xgoXF3Py4jcU Go1vfsGybHEXNurj304jmkBK0d83rYdYFNa58jY+6fCrt7b7SdxcjImvRbx0ByvB O/igAQxHLYZAVM+9eD8kHRt6nFkdllGkdynMPx82RllpjyZvxBm8hXeRCXvT78Ja 9aOx6YZLND6iLinAh2J+zFKTtl+iX8DD+39DMFEgLjgKJB84phux1h/2PP8RS2tp 5TqWy7ECgYEA+A8HEKKFTaYD4GQaiD+L4gOh2ZcLykdG8IIXRxzCPtv5VWKS2SCz WWyFoVRlV4b6q96PJwdS/6skbbWS98HIg3aqhOVaXyGxZHlzRgopE3OfRiDcf/Xd bO+Y7phH6h+hMBWpAAojJ+lWzGkg2DewCY0NjkUdOrFAZZWWLrQqGGMCgYEAlfe+ S3gXGqVk3ZyS4f8TyWrkKfVaRVa2KT0GGBJ8TNOB7xlf0oVmKCKSGoWbY5znt2e2 OTb6/zL0qzm1R9pNw5tUE5k/cCReZ20TpcHExoc+1prvmoCO8ToYMfGPOTBpRKBo Hdtx4xjBVe9omP6c/U8jfMDUL+cEKgvvjHUXv1kCgYEApTo1RYJLcoYjTOLAvYI+ ZYRv2SSAKPNDME4mvSpNxFr3gEVRdSkP7X+YnvY9LojtDXAIQEHjqgLQF/d69mZw bgir2it+/6DMrRUskDmSVK+OJsMavG0DWV1aq4ppVGxPDF1RHYKjGiGVvEBGLV8i daornlkw9/g64a86ws8kvusCgYBvnRs7//zyD/aqGUYYfUe0uKFnuPueb5LTzl8i u19XrnMeCLyQakhFxrUGmDm2QakTj1TH8GuOU9ZVOXX6LDeERa6lh4D3bZn1T/E3 hKd3OmFCR73cN6IrVxl60lXOMoGmWdwjnJd+dYYu9yfZ9mXRAX1f9AP4Qu+Oe6Ol 3d/2wQKBgQCgdA48bkRGFR/OqcGACNVQFcXQYvSabKOZkg303NH7p4pD8Ng6FDW+ r8r8+M/iMF9q7XvcX5pF8zgGk/MfHOdf9wWv7Uih7CIQzJLEs+OzNqx//Jn1EuV4 GBudByVPLqUDB5nvcDxTTsDP+gPFQtQ1mAWB1r18s9x4OioqvoV/6Q== -----END OPENSSH PRIVATE KEY-----",
          "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCRUM4Ax6c9yVDvPlTeLdBjDiVC6KMTLGcSBNeSTzwvbSagUFTi8mRKC69ResbM2If5YxZZZMBcFMN204cClAlJ1TQ/iVj7Q/cvDdZ5lp60+bnzdpwOVoKT0Nqo9CeOln/0MuqbHWvklgBlsKK5dYwDSXMlQ46eLC33gFYKfPf7QtusLuM2yJoLtxFzWSaP82a7zJ0Dh6inji0kyVpdv2edQjGCVSbTIvU0M5POiRM/TcVrsla3jqAyjpyjvnWdibjczA5v9xjRSHr6Ln1zNe4KzSEWlbISRAkONxA1eDL1y0jRH8mcFtDKRIkbwLRwH2ex/Bu25EhBWuCiPrl6uVdr",
          "mail@to.net"
        ]
      },
      "input": [
        {
          "origin": "http.request.parameter",
          "name": "name",
          "value": "$1"
        }
      ],
      "expected": [
        {
          "origin": "http.request.parameter",
          "name": "name",
          "redacted": true
        }
      ]
    },
    {
      "type": "VULNERABILITIES",
      "description": "Weak cipher should not be redacted",
      "input": [
        {
          "type": "WEAK_CIPHER",
          "evidence": {
            "value": "SHA1"
          }
        }
      ],
      "expected": {
        "vulnerabilities": [
          {
            "type": "WEAK_CIPHER",
            "evidence": {
              "value": "SHA1"
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Weak hash should not be redacted",
      "input": [
        {
          "type": "WEAK_HASH",
          "evidence": {
            "value": "MD5"
          }
        }
      ],
      "expected": {
        "vulnerabilities": [
          {
            "type": "WEAK_HASH",
            "evidence": {
              "value": "MD5"
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query without sensitive data",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "table",
                  "parameterValue": "users"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "table",
            "value": "users"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "value": "users"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with sensitive source",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "secret",
                  "parameterValue": "users"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "secret",
            "redacted": true,
            "pattern": "abcde"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcde"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with single quoted string literal $1",
      "parameters": {
        "$1": [
          "john",
          "username with 🌉 surrogate"
        ]
      },
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = '$1' and last_name = 'another surrogate 😃'",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "table",
                  "parameterValue": "users"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "table",
            "value": "users"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "value": "users"
                },
                {
                  "value": " where username = '"
                },
                {
                  "redacted": true
                },
                {
                  "value": "' and last_name = '"
                },
                {
                  "redacted": true
                },
                {
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with single quoted string literal and null source",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'user'",
            "ranges": [
              {
                "start": 38,
                "end": 42,
                "iinfo": {
                  "type": "http.request.body"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.body"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where username = '"
                },
                {
                  "redacted": true,
                  "source": 0,
                  "pattern": "****"
                },
                {
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 query with double quoted string literal $2",
      "parameters": {
        "$1": [
          "MYSQL",
          "MARIADB",
          "SQLITE"
        ],
        "$2": [
          "john",
          "username with 🌉 surrogate"
        ]
      },
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = \"$2\" and last_name = 'another surrogate 😃'",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "table",
                  "parameterValue": "users"
                }
              }
            ],
            "dialect": "$1"
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "table",
            "value": "users"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "value": "users"
                },
                {
                  "value": " where username = \""
                },
                {
                  "redacted": true
                },
                {
                  "value": "\" and last_name = '"
                },
                {
                  "redacted": true
                },
                {
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with escaped string literal",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'I''m an escaped string'",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "table",
                  "parameterValue": "users"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "table",
            "value": "users"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "value": "users"
                },
                {
                  "value": " where username = '"
                },
                {
                  "redacted": true
                },
                {
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 query with escaped string literal",
      "parameters": {
        "$1": [
          "MYSQL",
          "MARIADB",
          "SQLITE"
        ]
      },
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = \"I\\\"m an escaped string\"",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "table",
                  "parameterValue": "users"
                }
              }
            ],
            "dialect": "$1"
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "table",
            "value": "users"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "value": "users"
                },
                {
                  "value": " where username = \""
                },
                {
                  "redacted": true
                },
                {
                  "value": "\""
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 query with arbitrary escaped string literal",
      "parameters": {
        "$1": [
          "ORACLE"
        ],
        "$2": [
          "%",
          "$",
          "Z"
        ]
      },
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = q'$2I'm an escaped string$2' and common_name = 'doe' or last_name = q'$2I'm another escaped string$2'",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "table",
                  "parameterValue": "users"
                }
              }
            ],
            "dialect": "$1"
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "table",
            "value": "users"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "value": "users"
                },
                {
                  "value": " where username = q'$2"
                },
                {
                  "redacted": true
                },
                {
                  "value": "$2' and common_name = '"
                },
                {
                  "redacted": true
                },
                {
                  "value": "' or last_name = q'$2"
                },
                {
                  "redacted": true
                },
                {
                  "value": "$2'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 query with matched escaped string literal (< and >)",
      "parameters": {
        "$1": [
          "ORACLE"
        ]
      },
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = q'<I'm an escaped string>' and common_name = 'doe' or last_name = q'!I'm another escaped string!'",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "table",
                  "parameterValue": "users"
                }
              }
            ],
            "dialect": "$1"
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "table",
            "value": "users"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "value": "users"
                },
                {
                  "value": " where username = q'<"
                },
                {
                  "redacted": true
                },
                {
                  "value": ">' and common_name = '"
                },
                {
                  "redacted": true
                },
                {
                  "value": "' or last_name = q'!"
                },
                {
                  "redacted": true
                },
                {
                  "value": "!'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 query with escaped string literal $2",
      "parameters": {
        "$1": [
          "POSTGRES"
        ],
        "$2": [
          "$$",
          "$escape$"
        ]
      },
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = $2I'm an escaped string$2 and common_name = 'doe' or last_name = $TEST$I'm another escaped string$$$TEST$",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "table",
                  "parameterValue": "users"
                }
              }
            ],
            "dialect": "$1"
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "table",
            "value": "users"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "value": "users"
                },
                {
                  "value": " where username = $2"
                },
                {
                  "redacted": true
                },
                {
                  "value": "$2 and common_name = '"
                },
                {
                  "redacted": true
                },
                {
                  "value": "' or last_name = $TEST$"
                },
                {
                  "redacted": true
                },
                {
                  "value": "$TEST$"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with numeric literal $1",
      "parameters": {
        "$1": [
          "0",
          "12345",
          "+12345",
          "-12345",
          "12.345",
          ".2345",
          "12.345E3",
          "12.345E+3",
          "12.345E-3",
          "12E-3",
          "X'12AE'",
          "0x12AE",
          "B'0011'",
          "0b0011"
        ]
      },
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where user_colum_12345 = $1",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "table",
                  "parameterValue": "users"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "table",
            "value": "users"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "value": "users"
                },
                {
                  "value": " where user_colum_12345 = "
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with block comment",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users/*\nThis is a block comment\n*/",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "table",
                  "parameterValue": "users"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "table",
            "value": "users"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "value": "users"
                },
                {
                  "value": "/*"
                },
                {
                  "redacted": true
                },
                {
                  "value": "*/"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with line comment",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users -- This is a line comment",
            "ranges": [
              {
                "start": 14,
                "end": 19,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "table",
                  "parameterValue": "users"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "table",
            "value": "users"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from "
                },
                {
                  "source": 0,
                  "value": "users"
                },
                {
                  "value": " --"
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with string literal matching tainted range",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'john'",
            "ranges": [
              {
                "start": 38,
                "end": 42,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "username",
                  "parameterValue": "john"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "username",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where username = '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcd"
                },
                {
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with numeric literal matching tainted range",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where user_id = 123",
            "ranges": [
              {
                "start": 36,
                "end": 39,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "user_id",
                  "parameterValue": "123"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "user_id",
            "redacted": true,
            "pattern": "abc"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where user_id = "
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abc"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with string literal overlapping sensitive source",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where password = '12345'",
            "ranges": [
              {
                "start": 38,
                "end": 43,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "password",
                  "parameterValue": "12345"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "password",
            "redacted": true,
            "pattern": "abcde"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where password = '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcde"
                },
                {
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with string literal partially overlapping sensitive source",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where password = '12345:{xyz}'",
            "ranges": [
              {
                "start": 38,
                "end": 43,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "password",
                  "parameterValue": "12345"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "password",
            "redacted": true,
            "pattern": "abcde"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where password = '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcde"
                },
                {
                  "redacted": true
                },
                {
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with string literal partially overlapped with tainted ranges",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'john:doe'",
            "ranges": [
              {
                "start": 38,
                "end": 42,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "first_name",
                  "parameterValue": "john"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "first_name",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where username = '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcd"
                },
                {
                  "redacted": true
                },
                {
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with string literal containing tainted range",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'john:doe:ADMIN'",
            "ranges": [
              {
                "start": 43,
                "end": 46,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "last_name",
                  "parameterValue": "doe"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "last_name",
            "redacted": true,
            "pattern": "abc"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where username = '"
                },
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abc"
                },
                {
                  "redacted": true
                },
                {
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with string literal and tainted range crossing boundaries",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'john'",
            "ranges": [
              {
                "start": 26,
                "end": 43,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "clause",
                  "parameterValue": "username = 'john'"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "clause",
            "redacted": true,
            "pattern": "abcdefghijklmnopq"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where "
                },
                {
                  "source": 0,
                  "value": "username = '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "mnop"
                },
                {
                  "source": 0,
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with string literal and weird tainted range crossing boundaries",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'john:ADMIN_ROLE'",
            "ranges": [
              {
                "start": 26,
                "end": 42,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "clause",
                  "parameterValue": "username = 'john"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "clause",
            "redacted": true,
            "pattern": "abcdefghijklmnop"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where "
                },
                {
                  "source": 0,
                  "value": "username = '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "mnop"
                },
                {
                  "redacted": true
                },
                {
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with multiple ranges and literals",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select id as \"super user id\"\n\tfrom users\n\twhere username = 'john:doe' and password LIKE 'super_secure%' and user_id_123 > 00000",
            "ranges": [
              {
                "start": 60,
                "end": 64,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "first_name",
                  "parameterValue": "john"
                }
              },
              {
                "start": 65,
                "end": 68,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "last_name",
                  "parameterValue": "doe"
                }
              },
              {
                "start": 89,
                "end": 101,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "password",
                  "parameterValue": "super_secure"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "first_name",
            "redacted": true,
            "pattern": "abcd"
          },
          {
            "origin": "http.request.parameter",
            "name": "last_name",
            "redacted": true,
            "pattern": "abc"
          },
          {
            "origin": "http.request.parameter",
            "name": "password",
            "redacted": true,
            "pattern": "abcdefghijkl"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select id as \"super user id\"\n\tfrom users\n\twhere username = '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcd"
                },
                {
                  "redacted": true
                },
                {
                  "source": 1,
                  "redacted": true,
                  "pattern": "abc"
                },
                {
                  "value": "' and password LIKE '"
                },
                {
                  "source": 2,
                  "redacted": true,
                  "pattern": "abcdefghijkl"
                },
                {
                  "redacted": true
                },
                {
                  "value": "' and user_id_123 > "
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Query with tainted range in two LIKEs with not tainted % char",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from table where name LIKE '%searchparam%' OR description LIKE '%searchparam%'",
            "ranges": [
              {
                "start": 38,
                "end": 49,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "query",
                  "parameterValue": "searchparam"
                }
              },
              {
                "start": 74,
                "end": 85,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "query",
                  "parameterValue": "searchparam"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "query",
            "redacted": true,
            "pattern": "abcdefghijk"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from table where name LIKE '"
                },
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcdefghijk"
                },
                {
                  "redacted": true
                },
                {
                  "value": "' OR description LIKE '"
                },
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcdefghijk"
                },
                {
                  "redacted": true
                },
                {
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Full query tainted",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from table where name LIKE '%searchparam%' OR description LIKE '%searchparam%'",
            "ranges": [
              {
                "start": 0,
                "end": 87,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "query",
                  "parameterValue": "select * from table where name LIKE '%searchparam%' OR description LIKE '%searchparam%'"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "query",
            "redacted": true,
            "pattern": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxy"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "source": 0,
                  "value": "select * from table where name LIKE '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "LMNOPQRSTUVWX"
                },
                {
                  "source": 0,
                  "value": "' OR description LIKE '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "LMNOPQRSTUVWX"
                },
                {
                  "source": 0,
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Ldap with literal and filter $1",
      "parameters": {
        "$1": [
          "=",
          "~=",
          ">=",
          "<="
        ]
      },
      "input": [
        {
          "type": "LDAP_INJECTION",
          "evidence": {
            "value": "(cn$1Babs Jensen)",
            "ranges": [
              {
                "start": 1,
                "end": 3,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "attr",
                  "parameterValue": "cn"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "attr",
            "value": "cn"
          }
        ],
        "vulnerabilities": [
          {
            "type": "LDAP_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "("
                },
                {
                  "source": 0,
                  "value": "cn"
                },
                {
                  "value": "$1"
                },
                {
                  "redacted": true
                },
                {
                  "value": ")"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Ldap with extensible matching",
      "input": [
        {
          "type": "LDAP_INJECTION",
          "evidence": {
            "value": "(:DN:2.4.6.8.10:=Dino)",
            "ranges": [
              {
                "start": 5,
                "end": 15,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "oid",
                  "parameterValue": "2.4.6.8.10"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "oid",
            "value": "2.4.6.8.10"
          }
        ],
        "vulnerabilities": [
          {
            "type": "LDAP_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "(:DN:"
                },
                {
                  "source": 0,
                  "value": "2.4.6.8.10"
                },
                {
                  "value": ":="
                },
                {
                  "redacted": true
                },
                {
                  "value": ")"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Ldap complex search",
      "input": [
        {
          "type": "LDAP_INJECTION",
          "evidence": {
            "value": "(cn=Babs Jensen)\n(!(cn=Tim Howes))\n(&(objectClass=Person)(|(sn=Jensen)(cn=Babs J*)))\n(o=univ*of*mich*)\n(seeAlso=)",
            "ranges": [
              {
                "start": 4,
                "end": 15,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "cn",
                  "parameterValue": "Babs Jensen"
                }
              },
              {
                "start": 63,
                "end": 69,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "cn",
                  "parameterValue": "Babs Jensen"
                }
              },
              {
                "start": 74,
                "end": 80,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "cn",
                  "parameterValue": "Babs Jensen"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "cn",
            "redacted": true,
            "pattern": "abcdefghijk"
          }
        ],
        "vulnerabilities": [
          {
            "type": "LDAP_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "(cn="
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcdefghijk"
                },
                {
                  "value": ")\n(!(cn="
                },
                {
                  "redacted": true
                },
                {
                  "value": "))\n(&(objectClass="
                },
                {
                  "redacted": true
                },
                {
                  "value": ")(|(sn="
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "fghijk"
                },
                {
                  "value": ")(cn="
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcdef"
                },
                {
                  "redacted": true
                },
                {
                  "value": ")))\n(o="
                },
                {
                  "redacted": true
                },
                {
                  "value": ")\n(seeAlso=)"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Ldap with escaping",
      "input": [
        {
          "type": "LDAP_INJECTION",
          "evidence": {
            "value": "(o=Parens R Us \\28for all your parenthetical needs\\29)\n(cn=*\\2A*)\n(filename=C:\\5cMyFile)\n(bin=\\00\\00\\00\\04)\n(sn=Lu\\c4\\8di\\c4\\87)\n(1.3.6.1.4.1.1466.0=\\04\\02\\48\\69)",
            "ranges": [
              {
                "start": 76,
                "end": 87,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "file",
                  "parameterValue": "C:\\5cMyFile"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "file",
            "redacted": true,
            "pattern": "abcdefghijk"
          }
        ],
        "vulnerabilities": [
          {
            "type": "LDAP_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "(o="
                },
                {
                  "redacted": true
                },
                {
                  "value": ")\n(cn="
                },
                {
                  "redacted": true
                },
                {
                  "value": ")\n(filename="
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcdefghijk"
                },
                {
                  "value": ")\n(bin="
                },
                {
                  "redacted": true
                },
                {
                  "value": ")\n(sn="
                },
                {
                  "redacted": true
                },
                {
                  "value": ")\n(1.3.6.1.4.1.1466.0="
                },
                {
                  "redacted": true
                },
                {
                  "value": ")"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Path traversal should not be redacted",
      "input": [
        {
          "type": "PATH_TRAVERSAL",
          "evidence": {
            "value": "/home/user/my_document.txt",
            "ranges": [
              {
                "start": 11,
                "end": 26,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "file",
                  "parameterValue": "my_document.txt"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "file",
            "value": "my_document.txt"
          }
        ],
        "vulnerabilities": [
          {
            "type": "PATH_TRAVERSAL",
            "evidence": {
              "valueParts": [
                {
                  "value": "/home/user/"
                },
                {
                  "value": "my_document.txt",
                  "source": 0
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Command injection only keeps the first command",
      "input": [
        {
          "type": "COMMAND_INJECTION",
          "evidence": {
            "value": "cat /home/user/file.txt",
            "ranges": [
              {
                "start": 15,
                "end": 23,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "file",
                  "parameterValue": "file.txt"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "file",
            "redacted": true,
            "pattern": "abcdefgh"
          }
        ],
        "vulnerabilities": [
          {
            "type": "COMMAND_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "cat "
                },
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcdefgh"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Command injection does not redact commands that trigger other commands",
      "parameters": {
        "$1": [
          "sudo",
          "doas"
        ]
      },
      "input": [
        {
          "type": "COMMAND_INJECTION",
          "evidence": {
            "value": "$1 cat /home/user/file.txt",
            "ranges": [
              {
                "start": 20,
                "end": 28,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "file",
                  "parameterValue": "file.txt"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "file",
            "redacted": true,
            "pattern": "abcdefgh"
          }
        ],
        "vulnerabilities": [
          {
            "type": "COMMAND_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "$1 cat "
                },
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcdefgh"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Command injection does not redact ranges with only whitespaces",
      "input": [
        {
          "type": "COMMAND_INJECTION",
          "evidence": {
            "value": "ls -lah",
            "ranges": [
              {
                "start": 0,
                "end": 2,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "command",
                  "parameterValue": "ls"
                }
              },
              {
                "start": 3,
                "end": 7,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "argument",
                  "parameterValue": "-lah"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "command",
            "value": "ls"
          },
          {
            "origin": "http.request.parameter",
            "name": "argument",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "COMMAND_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "source": 0,
                  "value": "ls"
                },
                {
                  "value": " "
                },
                {
                  "source": 1,
                  "redacted": true,
                  "pattern": "abcd"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 without authority or query params",
      "parameters": {
        "$1": [
          "SSRF",
          "UNVALIDATED_REDIRECT"
        ]
      },
      "input": [
        {
          "type": "$1",
          "evidence": {
            "value": "http://datadoghq.com",
            "ranges": [
              {
                "start": 7,
                "end": 20,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "host",
                  "parameterValue": "datadoghq.com"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "host",
            "value": "datadoghq.com"
          }
        ],
        "vulnerabilities": [
          {
            "type": "$1",
            "evidence": {
              "valueParts": [
                {
                  "value": "http://"
                },
                {
                  "source": 0,
                  "value": "datadoghq.com"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 with authority $2",
      "parameters": {
        "$1": [
          "SSRF",
          "UNVALIDATED_REDIRECT"
        ],
        "$2": [
          "user",
          ":",
          "user:",
          ":password",
          "user:password"
        ]
      },
      "input": [
        {
          "type": "$1",
          "evidence": {
            "value": "http://$2@datadoghq.com",
            "ranges": [
              {
                "start": 0,
                "end": 4,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "protocol",
                  "parameterValue": "http"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "protocol",
            "value": "http"
          }
        ],
        "vulnerabilities": [
          {
            "type": "$1",
            "evidence": {
              "valueParts": [
                {
                  "source": 0,
                  "value": "http"
                },
                {
                  "value": "://"
                },
                {
                  "redacted": true
                },
                {
                  "value": "@datadoghq.com"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 with query parameters or fragment",
      "parameters": {
        "$1": [
          "SSRF",
          "UNVALIDATED_REDIRECT"
        ],
        "$2": [
          "?",
          "#"
        ]
      },
      "input": [
        {
          "type": "$1",
          "evidence": {
            "value": "http://datadoghq.com$2first_name=john&last_name=doe",
            "ranges": [
              {
                "start": 7,
                "end": 20,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "host",
                  "parameterValue": "datadoghq.com"
                }
              },
              {
                "start": 32,
                "end": 36,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "first_name",
                  "parameterValue": "john"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "host",
            "value": "datadoghq.com"
          },
          {
            "origin": "http.request.parameter",
            "name": "first_name",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "$1",
            "evidence": {
              "valueParts": [
                {
                  "value": "http://"
                },
                {
                  "source": 0,
                  "value": "datadoghq.com"
                },
                {
                  "value": "$2first_name="
                },
                {
                  "source": 1,
                  "redacted": true,
                  "pattern": "abcd"
                },
                {
                  "value": "&last_name="
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 authority query and fragment",
      "parameters": {
        "$1": [
          "SSRF",
          "UNVALIDATED_REDIRECT"
        ]
      },
      "input": [
        {
          "type": "$1",
          "evidence": {
            "value": "https://user:password@datadoghq.com:443/api/v1/test/123/?param1=pone&param2=ptwo#fragment1=fone&fragment2=ftwo",
            "ranges": [
              {
                "start": 22,
                "end": 35,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "host",
                  "parameterValue": "datadoghq.com"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "host",
            "value": "datadoghq.com"
          }
        ],
        "vulnerabilities": [
          {
            "type": "$1",
            "evidence": {
              "valueParts": [
                {
                  "value": "https://"
                },
                {
                  "redacted": true
                },
                {
                  "value": "@"
                },
                {
                  "source": 0,
                  "value": "datadoghq.com"
                },
                {
                  "value": ":443/api/v1/test/123/?param1="
                },
                {
                  "redacted": true
                },
                {
                  "value": "&param2="
                },
                {
                  "redacted": true
                },
                {
                  "value": "#fragment1="
                },
                {
                  "redacted": true
                },
                {
                  "value": "&fragment2="
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Weak randomness should not be redacted",
      "input": [
        {
          "type": "WEAK_RANDOMNESS",
          "evidence": {
            "value": "java.util.Math"
          }
        }
      ],
      "expected": {
        "vulnerabilities": [
          {
            "type": "WEAK_RANDOMNESS",
            "evidence": {
              "value": "java.util.Math"
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Sensitive source should be redacted fully in the evidence (source matches)",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'john'",
            "ranges": [
              {
                "start": 26,
                "end": 43,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "password",
                  "parameterValue": "username = 'john'"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "password",
            "redacted": true,
            "pattern": "abcdefghijklmnopq"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where "
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcdefghijklmnopq"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Sensitive sources should be redacted fully in the evidence (source does not match)",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'my user'",
            "ranges": [
              {
                "start": 26,
                "end": 46,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "password",
                  "parameterValue": "username = 'my%20user'"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "password",
            "redacted": true,
            "pattern": "abcdefghijklmnopqrstuv"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where "
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "********************"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Sensitive tainted range (source matches)",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'john'",
            "ranges": [
              {
                "start": 26,
                "end": 43,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "clause",
                  "parameterValue": "username = 'john'"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "clause",
            "redacted": true,
            "pattern": "abcdefghijklmnopq"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where "
                },
                {
                  "source": 0,
                  "value": "username = '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "mnop"
                },
                {
                  "source": 0,
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Sensitive tainted range (source does not match)",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'my user'",
            "ranges": [
              {
                "start": 26,
                "end": 46,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "clause",
                  "parameterValue": "username = 'my%20user'"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "clause",
            "redacted": true,
            "pattern": "abcdefghijklmnopqrstuv"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where "
                },
                {
                  "source": 0,
                  "value": "username = '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "*******"
                },
                {
                  "source": 0,
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "SQLi exploited",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "SELECT * FROM Users WHERE email = '' OR TRUE --' AND password = '81dc9bdb52d04dc20036dbd8313ed055' AND deletedAt IS NULL",
            "ranges": [
              {
                "start": 35,
                "end": 47,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "param",
                  "parameterValue": "' OR TRUE --"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "param",
            "value": "' OR TRUE --"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "SELECT * FROM Users WHERE email = '"
                },
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "value": "' OR TRUE --"
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Consecutive ranges - at the beginning",
      "input": [
        {
          "type": "UNVALIDATED_REDIRECT",
          "evidence": {
            "value": "https://user:password@datadoghq.com:443/api/v1/test/123/?param1=pone&param2=ptwo#fragment1=fone&fragment2=ftwo",
            "ranges": [
              {
                "start": 0,
                "end": 4,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "protocol",
                  "parameterValue": "http"
                }
              },
              {
                "start": 4,
                "end": 5,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "secure",
                  "parameterValue": "s"
                }
              },
              {
                "start": 22,
                "end": 35,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "host",
                  "parameterValue": "datadoghq.com"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "protocol",
            "value": "http"
          },
          {
            "origin": "http.request.parameter",
            "name": "secure",
            "value": "s"
          },
          {
            "origin": "http.request.parameter",
            "name": "host",
            "value": "datadoghq.com"
          }
        ],
        "vulnerabilities": [
          {
            "type": "UNVALIDATED_REDIRECT",
            "evidence": {
              "valueParts": [
                {
                  "source": 0,
                  "value": "http"
                },
                {
                  "source": 1,
                  "value": "s"
                },
                {
                  "value": "://"
                },
                {
                  "redacted": true
                },
                {
                  "value": "@"
                },
                {
                  "source": 2,
                  "value": "datadoghq.com"
                },
                {
                  "value": ":443/api/v1/test/123/?param1="
                },
                {
                  "redacted": true
                },
                {
                  "value": "&param2="
                },
                {
                  "redacted": true
                },
                {
                  "value": "#fragment1="
                },
                {
                  "redacted": true
                },
                {
                  "value": "&fragment2="
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 - Tainted range based redaction ",
      "parameters": {
        "$1": [
          "XSS",
          "CODE_INJECTION",
          "EMAIL_HTML_INJECTION",
          "TEMPLATE_INJECTION",
          "UNTRUSTED_DESERIALIZATION"
        ]
      },
      "input": [
        {
          "type": "$1",
          "evidence": {
            "value": "this could be a super long text, so we need to reduce it before send it to the backend. This redaction strategy applies to XSS vulnerability but can be extended to future ones",
            "ranges": [
              {
                "start": 123,
                "end": 126,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "type",
                  "parameterValue": "XSS"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "type",
            "value": "XSS"
          }
        ],
        "vulnerabilities": [
          {
            "type": "$1",
            "evidence": {
              "valueParts": [
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "value": "XSS"
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 - Tainted range based redaction - with redactable source ",
      "parameters": {
        "$1": [
          "XSS",
          "CODE_INJECTION",
          "EMAIL_HTML_INJECTION",
          "TEMPLATE_INJECTION",
          "UNTRUSTED_DESERIALIZATION"
        ]
      },
      "input": [
        {
          "type": "$1",
          "evidence": {
            "value": "this could be a super long text, so we need to reduce it before send it to the backend. This redaction strategy applies to XSS vulnerability but can be extended to future ones",
            "ranges": [
              {
                "start": 123,
                "end": 126,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "password",
                  "parameterValue": "XSS"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "password",
            "redacted": true,
            "pattern": "abc"
          }
        ],
        "vulnerabilities": [
          {
            "type": "$1",
            "evidence": {
              "valueParts": [
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abc"
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 - Tainted range based redaction - with null source ",
      "parameters": {
        "$1": [
          "XSS",
          "CODE_INJECTION",
          "EMAIL_HTML_INJECTION",
          "TEMPLATE_INJECTION",
          "UNTRUSTED_DESERIALIZATION"
        ]
      },
      "input": [
        {
          "type": "$1",
          "evidence": {
            "value": "this could be a super long text, so we need to reduce it before send it to the backend. This redaction strategy applies to XSS vulnerability but can be extended to future ones",
            "ranges": [
              {
                "start": 123,
                "end": 126,
                "iinfo": {
                  "type": "http.request.body"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.body"
          }
        ],
        "vulnerabilities": [
          {
            "type": "$1",
            "evidence": {
              "valueParts": [
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "value": "XSS"
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 - Tainted range based redaction - multiple ranges",
      "parameters": {
        "$1": [
          "XSS",
          "CODE_INJECTION",
          "EMAIL_HTML_INJECTION",
          "TEMPLATE_INJECTION",
          "UNTRUSTED_DESERIALIZATION"
        ]
      },
      "input": [
        {
          "type": "$1",
          "evidence": {
            "value": "this could be a super long text, so we need to reduce it before send it to the backend. This redaction strategy applies to XSS vulnerability but can be extended to future ones",
            "ranges": [
              {
                "start": 16,
                "end": 26,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "text",
                  "parameterValue": "super long"
                }
              },
              {
                "start": 123,
                "end": 126,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "type",
                  "parameterValue": "XSS"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "text",
            "value": "super long"
          },
          {
            "origin": "http.request.parameter",
            "name": "type",
            "value": "XSS"
          }
        ],
        "vulnerabilities": [
          {
            "type": "$1",
            "evidence": {
              "valueParts": [
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "value": "super long"
                },
                {
                  "redacted": true
                },
                {
                  "source": 1,
                  "value": "XSS"
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 - Tainted range based redaction - first range at the beginning ",
      "parameters": {
        "$1": [
          "XSS",
          "CODE_INJECTION",
          "EMAIL_HTML_INJECTION",
          "TEMPLATE_INJECTION",
          "UNTRUSTED_DESERIALIZATION"
        ]
      },
      "input": [
        {
          "type": "$1",
          "evidence": {
            "value": "this could be a super long text, so we need to reduce it before send it to the backend. This redaction strategy applies to XSS vulnerability but can be extended to future ones",
            "ranges": [
              {
                "start": 0,
                "end": 4,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "text",
                  "parameterValue": "this"
                }
              },
              {
                "start": 123,
                "end": 126,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "type",
                  "parameterValue": "XSS"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "text",
            "value": "this"
          },
          {
            "origin": "http.request.parameter",
            "name": "type",
            "value": "XSS"
          }
        ],
        "vulnerabilities": [
          {
            "type": "$1",
            "evidence": {
              "valueParts": [
                {
                  "source": 0,
                  "value": "this"
                },
                {
                  "redacted": true
                },
                {
                  "source": 1,
                  "value": "XSS"
                },
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 - Tainted range based redaction - last range at the end ",
      "parameters": {
        "$1": [
          "XSS",
          "CODE_INJECTION",
          "EMAIL_HTML_INJECTION",
          "TEMPLATE_INJECTION",
          "UNTRUSTED_DESERIALIZATION"
        ]
      },
      "input": [
        {
          "type": "$1",
          "evidence": {
            "value": "this could be a super long text, so we need to reduce it before send it to the backend. This redaction strategy applies to XSS",
            "ranges": [
              {
                "start": 0,
                "end": 4,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "text",
                  "parameterValue": "this"
                }
              },
              {
                "start": 123,
                "end": 126,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "type",
                  "parameterValue": "XSS"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "text",
            "value": "this"
          },
          {
            "origin": "http.request.parameter",
            "name": "type",
            "value": "XSS"
          }
        ],
        "vulnerabilities": [
          {
            "type": "$1",
            "evidence": {
              "valueParts": [
                {
                  "source": 0,
                  "value": "this"
                },
                {
                  "redacted": true
                },
                {
                  "source": 1,
                  "value": "XSS"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "$1 - Tainted range based redaction - whole text ",
      "parameters": {
        "$1": [
          "XSS",
          "CODE_INJECTION",
          "EMAIL_HTML_INJECTION",
          "TEMPLATE_INJECTION",
          "UNTRUSTED_DESERIALIZATION"
        ]
      },
      "input": [
        {
          "type": "$1",
          "evidence": {
            "value": "this could be a super long text, so we need to reduce it before send it to the backend. This redaction strategy applies to XSS",
            "ranges": [
              {
                "start": 0,
                "end": 126,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "text",
                  "parameterValue": "this could be a super long text, so we need to reduce it before send it to the backend. This redaction strategy applies to XSS"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "text",
            "value": "this could be a super long text, so we need to reduce it before send it to the backend. This redaction strategy applies to XSS"
          }
        ],
        "vulnerabilities": [
          {
            "type": "$1",
            "evidence": {
              "valueParts": [
                {
                  "source": 0,
                  "value": "this could be a super long text, so we need to reduce it before send it to the backend. This redaction strategy applies to XSS"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Mongodb json query with sensitive source",
      "input": [
        {
          "type": "NOSQL_MONGODB_INJECTION",
          "evidence": {
            "value": {
              "password": "1234"
            },
            "ranges": [
              {
                "start": 0,
                "end": 4,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "password",
                  "parameterValue": "1234"
                }
              }
            ],
            "rangesToApply": {
              "password": [
                {
                  "start": 0,
                  "end": 4,
                  "iinfo": {
                    "type": "http.request.parameter",
                    "parameterName": "password",
                    "parameterValue": "1234"
                  }
                }
              ]
            }
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "password",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "NOSQL_MONGODB_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "{\n  \"password\": \""
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcd"
                },
                {
                  "value": "\"\n}"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Mongodb json query with non sensitive source",
      "input": [
        {
          "type": "NOSQL_MONGODB_INJECTION",
          "evidence": {
            "value": {
              "username": "user"
            },
            "ranges": [
              {
                "start": 0,
                "end": 4,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "username",
                  "parameterValue": "user"
                }
              }
            ],
            "rangesToApply": {
              "username": [
                {
                  "start": 0,
                  "end": 4,
                  "iinfo": {
                    "type": "http.request.parameter",
                    "parameterName": "username",
                    "parameterValue": "user"
                  }
                }
              ]
            }
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "username",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "NOSQL_MONGODB_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "{\n  \"username\": \""
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcd"
                },
                {
                  "value": "\"\n}"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Mongodb json query with partial non sensitive source",
      "input": [
        {
          "type": "NOSQL_MONGODB_INJECTION",
          "evidence": {
            "value": {
              "username": "user"
            },
            "ranges": [
              {
                "start": 0,
                "end": 4,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "param",
                  "parameterValue": "PREFIX_user"
                }
              }
            ],
            "rangesToApply": {
              "username": [
                {
                  "start": 0,
                  "end": 4,
                  "iinfo": {
                    "type": "http.request.parameter",
                    "parameterName": "param",
                    "parameterValue": "PREFIX_user"
                  }
                }
              ]
            }
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "param",
            "redacted": true,
            "pattern": "abcdefghijk"
          }
        ],
        "vulnerabilities": [
          {
            "type": "NOSQL_MONGODB_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "{\n  \"username\": \""
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "hijk"
                },
                {
                  "value": "\"\n}"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Mongodb json query with non sensitive source and other fields",
      "input": [
        {
          "type": "NOSQL_MONGODB_INJECTION",
          "evidence": {
            "value": {
              "username": "user",
              "secret": "SECRET_VALUE"
            },
            "ranges": [
              {
                "start": 0,
                "end": 4,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "username",
                  "parameterValue": "user"
                }
              }
            ],
            "rangesToApply": {
              "username": [
                {
                  "start": 0,
                  "end": 4,
                  "iinfo": {
                    "type": "http.request.parameter",
                    "parameterName": "username",
                    "parameterValue": "user"
                  }
                }
              ]
            }
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "username",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "NOSQL_MONGODB_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "{\n  \"username\": \""
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcd"
                },
                {
                  "value": "\",\n  \"secret\": \""
                },
                {
                  "redacted": true
                },
                {
                  "value": "\"\n}"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Mongodb json query with sensitive value in a key",
      "input": [
        {
          "type": "NOSQL_MONGODB_INJECTION",
          "evidence": {
            "value": {
              "username": "user",
              "token_usage": {
                "bearer zss8dR9QP81A": 10
              }
            },
            "ranges": [
              {
                "start": 0,
                "end": 4,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "username",
                  "parameterValue": "user"
                }
              }
            ],
            "rangesToApply": {
              "username": [
                {
                  "start": 0,
                  "end": 4,
                  "iinfo": {
                    "type": "http.request.parameter",
                    "parameterName": "username",
                    "parameterValue": "user"
                  }
                }
              ]
            }
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "username",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "NOSQL_MONGODB_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "{\n  \"username\": \""
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcd"
                },
                {
                  "value": "\",\n  \"token_usage\": {\n    \""
                },
                {
                  "redacted": true
                },
                {
                  "value": "\": "
                },
                {
                  "redacted": true
                },
                {
                  "value": "\n  }\n}"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Redacted source that needs to be truncated",
      "input": [
        {
          "type": "SQL_INJECTION",
          "evidence": {
            "value": "select * from users where username = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Sed ut perspiciatis unde omnis iste natus error sit voluptatem ac'",
            "ranges": [
              {
                "start": 26,
                "end": 549,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "clause",
                  "parameterValue": "username = 'Lorem%20ipsum%20dolor%20sit%20amet,%20consectetur%20adipiscing%20elit,%20sed%20do%20eiusmod%20tempor%20incididunt%20ut%20labore%20et%20dolore%20magna%20aliqua.%20Ut%20enim%20ad%20minim%20veniam,%20quis%20nostrud%20exercitation%20ullamco%20laboris%20nisi%20ut%20aliquip%20ex%20ea%20commodo%20consequat.%20Duis%20aute%20irure%20dolor%20in%20reprehenderit%20in%20voluptate%20velit%20esse%20cillum%20dolore%20eu%20fugiat%20nulla%20pariatur.%20Excepteur%20sint%20occaecat%20cupidatat%20non%20proident,%20sunt%20in%20culpa%20qui%20officia%20deserunt%20mollit%20anim%20id%20est%20laborum.Sed%20ut%20perspiciatis%20unde%20omnis%20iste%20natus%20error%20sit%20voluptatem%20ac'"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "clause",
            "redacted": true,
            "pattern": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ab",
            "truncated": "right"
          }
        ],
        "vulnerabilities": [
          {
            "type": "SQL_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "select * from users where "
                },
                {
                  "source": 0,
                  "value": "username = '"
                },
                {
                  "source": 0,
                  "redacted": true,
                  "truncated": "right",
                  "pattern": "**********************************************************************************************************************************************************************************************************************************************************"
                },
                {
                  "source": 0,
                  "value": "'"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "No redacted that needs to be truncated - whole text",
      "input": [
        {
          "type": "XSS",
          "evidence": {
            "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Sed ut perspiciatis unde omnis iste natus error sit voluptatem ac",
            "ranges": [
              {
                "start": 0,
                "end": 510,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "text",
                  "parameterValue": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Sed ut perspiciatis unde omnis iste natus error sit voluptatem ac"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "text",
            "truncated": "right",
            "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure do"
          }
        ],
        "vulnerabilities": [
          {
            "type": "XSS",
            "evidence": {
              "valueParts": [
                {
                  "source": 0,
                  "truncated": "right",
                  "value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure do"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Header injection without sensitive data",
      "input": [
        {
          "type": "HEADER_INJECTION",
          "evidence": {
            "value": "custom: text",
            "ranges": [
              {
                "start": 8,
                "end": 12,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "param",
                  "parameterValue": "text"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "param",
            "value": "text"
          }
        ],
        "vulnerabilities": [
          {
            "type": "HEADER_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "custom: "
                },
                {
                  "source": 0,
                  "value": "text"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Header injection with only sensitive data from tainted",
      "input": [
        {
          "type": "HEADER_INJECTION",
          "evidence": {
            "value": "custom: pass",
            "ranges": [
              {
                "start": 8,
                "end": 12,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "password",
                  "parameterValue": "pass"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "password",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "HEADER_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "custom: "
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcd"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Header injection with partial sensitive data from tainted",
      "input": [
        {
          "type": "HEADER_INJECTION",
          "evidence": {
            "value": "custom: this is pass",
            "ranges": [
              {
                "start": 16,
                "end": 20,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "password",
                  "parameterValue": "pass"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "password",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "HEADER_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "custom: this is "
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcd"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Header injection with sensitive data from header name",
      "input": [
        {
          "type": "HEADER_INJECTION",
          "evidence": {
            "value": "password: text",
            "ranges": [
              {
                "start": 10,
                "end": 14,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "param",
                  "parameterValue": "text"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "param",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "HEADER_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "password: "
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcd"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Header injection with sensitive data from header value",
      "input": [
        {
          "type": "HEADER_INJECTION",
          "evidence": {
            "value": "custom: bearer 1234123",
            "ranges": [
              {
                "start": 15,
                "end": 22,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "param",
                  "parameterValue": "1234123"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "param",
            "redacted": true,
            "pattern": "abcdefg"
          }
        ],
        "vulnerabilities": [
          {
            "type": "HEADER_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "custom: "
                },
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcdefg"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Header injection with sensitive data from header and tainted",
      "input": [
        {
          "type": "HEADER_INJECTION",
          "evidence": {
            "value": "password: this is pass",
            "ranges": [
              {
                "start": 18,
                "end": 22,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "password",
                  "parameterValue": "pass"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "password",
            "redacted": true,
            "pattern": "abcd"
          }
        ],
        "vulnerabilities": [
          {
            "type": "HEADER_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "password: "
                },
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "abcd"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Header injection with sensitive data from header and tainted (source does not match)",
      "input": [
        {
          "type": "HEADER_INJECTION",
          "evidence": {
            "value": "password: this is key word",
            "ranges": [
              {
                "start": 18,
                "end": 26,
                "iinfo": {
                  "type": "http.request.parameter",
                  "parameterName": "password",
                  "parameterValue": "key%20word"
                }
              }
            ]
          }
        }
      ],
      "expected": {
        "sources": [
          {
            "origin": "http.request.parameter",
            "name": "password",
            "redacted": true,
            "pattern": "abcdefghij"
          }
        ],
        "vulnerabilities": [
          {
            "type": "HEADER_INJECTION",
            "evidence": {
              "valueParts": [
                {
                  "value": "password: "
                },
                {
                  "redacted": true
                },
                {
                  "source": 0,
                  "redacted": true,
                  "pattern": "********"
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Hardcoded password with sensitive data in the variable name",
      "input": [
        {
          "type": "HARDCODED_PASSWORD",
          "evidence": {
            "value": "gho_apasswapasswapasswapasswapasswapassw"
          }
        }
      ],
      "expected": {
        "vulnerabilities": [
          {
            "type": "HARDCODED_PASSWORD",
            "evidence": {
              "valueParts": [
                {
                  "redacted": true
                }
              ]
            }
          }
        ]
      }
    },
    {
      "type": "VULNERABILITIES",
      "description": "Hardcoded password without sensitive data in the variable name",
      "input": [
        {
          "type": "HARDCODED_PASSWORD",
          "evidence": {
            "value": "this_is_a_password"
          }
        }
      ],
      "expected": {
        "vulnerabilities": [
          {
            "type": "HARDCODED_PASSWORD",
            "evidence": {
              "value": "this_is_a_password"
            }
          }
        ]
      }
    }
  ]
}