Skip to content

secret redaction rewrites node names, which are part of the merge key #1754

Closed

Description

@CSchneiderHav

Summary

Secret redaction is applied to every string property of every node, including name. name is
part of the merge key, so a redacted name does not just hide a symbol — it changes the node's
identity.

In one graph of 240 repositories, indexed with REDACT_SECRETS=true, 448 nodes are literally
named [REDACTED]:

Label Nodes named [REDACTED]
Function 234
Variable 115
Class 85
Enum 8
Interface 6

Why a name trips the scanner at all

is_likely_secret calls a string a secret when it is at least 16 characters, contains one of ten
common words (key, secret, token, password, passwd, pwd, credential, auth,
private, access) and scores 3.8 bits of Shannon entropy. A method called
getAccessTokenForUser meets all three: it is long enough, it contains access and token, and
ordinary mixed-case identifiers sit well above 3.8 bits. Roughly 120 of 7,042 Java name
properties in our sample trip it.

Why it matters more than a hidden name

writer.py merges most labels on a key that includes name
(MERGE (n:Class {name: row.name, path: …, line_number: …})), so two different symbols whose
names were both redacted in the same file and line region can meet on one node. Module is worse:
_NAME_ONLY_MERGE_LABELS merges it on name alone, so every redacted module name in the whole
graph collapses onto a single node.

The downstream effects are quiet. Name-based call and inheritance resolution cannot match a symbol
whose name is the redaction marker, and the full-text index over name, source and docstring
cannot find it either, so queries return nothing rather than something wrong.

Suggestion

Identifiers are not values. The cheapest fix is to exclude the identity properties — name,
full_name and anything else that participates in a merge key — from the scan, and keep
redaction for the properties that carry user content (source, docstring, value). A stricter
alternative is to scan them but never allow a redaction to change a merge key, falling back to
storing the original name and recording a finding instead.

I am happy to send a patch for whichever shape you prefer.

Found while working on a separate over-redaction defect in the same function, reported with a fix
in #1753; this one is independent of that change and is not addressed by it.


Disclosure: this report was prepared with AI assistance (Claude Code) and reviewed by a human
before posting.

Activity

  1. github-actions commented on Oct 1, 2026

    @github-actions
    Contributor

    Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ

  2. moved this from Backlog tasks to In progress in CGC Progress Boardon Oct 9, 2026
  3. Shashankss1205 commented on Oct 9, 2026

    @Shashankss1205
    Collaborator

    A focused identity fix is open in #1760. Graph identity properties are preserved while source/docstring/value content remains subject to existing secret detection. Five new identity regressions plus the existing scanner suite pass (43 tests). Existing redacted names require reindexing after upgrading. This is independent of #1753.

  4. moved this from In progress to Done in CGC Progress Boardon Oct 15, 2026
  5. Shashankss1205 commented on Oct 15, 2026

    @Shashankss1205
    Collaborator

    Maintenance review — 15 October 2026

    Merged #1760. Graph identity names/paths/endpoints are preserved during redaction while content still gets scanned. Previously redacted identities require a forced re-index; #1766 separately improves multiline content redaction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions