desloppify icon indicating copy to clipboard operation
desloppify copied to clipboard

CSS custom-property and DOM attribute names are flagged as hardcoded secrets

Open drakemorey opened this issue 3 weeks ago • 0 comments

Problem

Desloppify 1.0 reports CSS custom-property names and DOM data-attribute names as high-confidence hardcoded secrets when their TypeScript constant name contains TOKEN.

Minimal reproduction (no application code or credentials):

from desloppify.engine.detectors.security.rules import _secret_name_entries

for line in [
    "export const VISUAL_FONT_TOKEN = '--sotto-font'",
    "export const THEME_TOKEN_PROBE_ATTRIBUTE = 'data-theme-token-probe'",
]:
    print(_secret_name_entries('example.ts', 1, line, False))

Actual: both produce hardcoded_secret_name with severity high and confidence high.

Expected: these public CSS/DOM identifiers should not be reported as credentials.

The name matcher recognizes TOKEN, while the non-secret value filters do not recognize CSS custom-property names or hyphenated DOM data-attribute names. Related earlier reports #148 and #496 are closed; these values still reproduce in the installed 1.0 build. A narrow fix should preserve detection of actual credential literals rather than suppress every TOKEN-named constant.

drakemorey avatar Nov 09 '26 17:11 drakemorey