A TODO comment is contemporary documentation. Someone who understood the code well enough to write the function also understood its gap well enough to name the gap. At the moment of writing, the author knew what was missing. They chose to ship without it. The decision may have been deliberate (ship now, fix in a follow-up) or accidental (the follow-up never happened, the person left, the codebase lost the context).
The shape this pattern describes is the case where the comment's claim is a security-relevant property: input validation, authentication, escaping, bounds checking, type guarding, authorization. If the comment says "TODO: verify this path is under the base directory" and the code concatenates the input path into a filesystem call without the verify, the codebase has declared its own path-traversal vulnerability. The comment is not evidence of bad faith. The comment is testimony that the issue was seen, named, and deferred.
Attackers read commented-intentions-now-public the same way maintainers should: as a shortlist of where the code self-identifies as weak. Grepping a repository for TODO, FIXME, XXX, HACK across security-sensitive code paths is a cheap and consistently rewarding exercise. Shipped TODOs compound over time because every year of uncorrected TODO is a year of additional certainty that nobody with commit access is going to fix this one. CVE issuance for long-standing TODOs consistently reveals that the comment pre-dates the exploit by years.
The pattern is not that TODO comments exist. Every codebase has them. The pattern is that a specific TODO in a specific file describes a specific security failure that the code below the TODO performs, and the combination has shipped long enough for researchers to find it.