Skip to main content
MediumContentOWASP A05:2021CWE-615

How to fix: Sensitive source code comment in response

An HTML comment in the response contains potentially sensitive information such as file paths, credentials, or developer notes.

Why it matters

HTML comments are visible to anyone who views source, revealing internal paths, developer notes about security weaknesses, API endpoints, or occasionally credentials that were left during development.

Production HTML responses should not contain developer comments.

How to fix it

  1. 1Remove all HTML comments from production templates
  2. 2Use build-time comment stripping in your bundler
  3. 3Audit HTML output for <!-- comments --> before deploying

Code examples

Remove sensitive comments before deploying

JavaScript
// Remove or replace sensitive comments before production:
// BAD:
// TODO: remove hardcoded API key: sk_live_abc123
// FIXME: SQL injection vulnerability on line 42
// NOTE: admin password is 'hunter2'

// Use a linter rule (e.g. eslint no-warning-comments) to catch TODOs in CI

References

Detected automatically by VulnRadar. The check id is source-code-comment, stable across every scan so you can filter or diff on it.

See every content check

Questions

How severe is Sensitive source code comment in response?
VulnRadar rates this medium severity in the content category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id source-code-comment, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Sensitive source code comment in response map to?
It maps to CWE-615. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for sensitive source code comment in response

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Sensitive source code comment in response fix | VulnRadar