Vulnerability Remediation

Vulnerabilities detected by HoundDog.ai can be fixed one of two ways:

Code Removal

Some vulnerabilities come from logging or streaming sensitive data to stdout or stderr. These are usually safe to fix by removing the logging or print statement completely. Example:

Before

Python
Copy

After

Python
Copy

Data Sanitization

Other cases involve data that must remain in the code, such as sending a user data to a monitoring tool like Datadog. In these situations, complete removal could cause unintended consequences, so the safer approach is to sanitize the value before use. This might involve redaction, masking, or encryption depending on the sensitivity of the data.

Before

Javascript
Copy

After

Javascript
Copy

Auto-Closing Issues

To ensure the scanner auto-closes the vulnerability after remediation, the variable name in the fixed version of the code must begin with sanitized. Use the style that matches your language or project:

  • sanitizedUserId (camelCase)
  • sanitized_user_id (snake_case)
  • SanitizedUserId (PascalCase)
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard