Skip to content
vetkitChecksChangelogDocumentation

vetkit.js.validation.host-suffix-match

A host, origin or e-mail domain is validated with endsWith() against a bare domain name. An attacker-registered domain such as evilexample.com also passes the check.

Last updated:

Suite: Security

javascript, typescript

A host, origin or e-mail domain is validated with endsWith() against a bare domain name. An attacker-registered domain such as evilexample.com also passes the check.

Category: SECURITY · Engine rule severity: WARNING

How to fix it

Compare the parsed hostname exactly, or check for the domain with a leading dot (host === 'example.com' || host.endsWith('.example.com'); for e-mail use '@example.com').

References

Source: packages/engine/rules/sast/javascript.yml.

Generated from shipped rule definitions at build time. Matching is a review signal, not proof of exploitability. “generic” denotes text matching, not complete language or framework coverage. Runtime configuration and available tools affect whether a rule runs.