What went wrong
RedactionCore looks for sensitive values in text and replaces each one with a placeholderOmitto · RedactionCore · The packagePlaceholdersGives repeated values one shared placeholder within a call. Different values of the same kind get different numbers.See it in the Omitto build. It finds them with detectorsOmitto · RedactionCore · The packageDetectorsGathers the stretches of text that every detector suggests, and removes repeats.See it in the Omitto build, and the detectors belong to groups that can be switched off. Switching off one group could leave a value with nothing to replace it, even though an enabled detector had matched the same text.
Why it happened
More than one detector can match the same stretch of text. For example, one pattern may be made for a single provider’s keys, and a more general one for any login secret. Each match is a candidate. Where candidates overlap, a step called the overlap resolverOmitto · RedactionCore · The packageOverlap resolverDrops disabled groups first. Then it picks winners by priority, by how sure each match is, and by length.See it in the Omitto build picks one winner by score. Candidates from disabled groups were removed only after that contest. So a high-priority candidate from a disabled group could knock out the enabled one. Then it was removed itself. Both detectors found the text. The order of the steps lost it.
What I changed
One part of RedactionCore runs these steps. It now removes candidates from disabled groups before the overlap resolver picks. Only allowed candidates compete. So a broader enabled detector can still take the match when the group for that one provider is off. Manual phrases, which are added by hand, stay in the contest even when automatic groups are disabled. The replacement stepOmitto · RedactionCore · The packageText replacementEdits the text from the end backwards, so earlier positions stay correct. It counts positions in UTF-16 units, a standard way of numbering the characters in text.See it in the Omitto build that follows has not changed.
How I know it works
Tests aimed at this case cover an overlap with a disabled group. They also cover manual phrases. A July audit of correctness lists the fix and 57 passing core tests. That supports this fix to the order of steps. It does not show that every kind of login secret will be recognized.