Match the account name as a whole word in /doc-review's scrub - #139
Merged
Merged
Conversation
The pre-publish scrub matched the account name from `id -un` as a bare substring. Any ordinary word containing it tripped the gate, as did a public GitHub handle that begins with it, so a clean review could not be posted without overriding the scrub. A gate that blocks harmless text teaches whoever runs it to work around it, which defeats the reason it fails closed. The name now has to stand alone, bounded by anything other than a letter or digit. That still catches every form that identifies the user: a home-directory path, the dash-encoded form in per-project directory names, an email address and the bare name in prose. The name is also escaped before it enters the pattern, since an account name can contain a dot or another character the regular expression would otherwise read as syntax.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/doc-review's pre-publish scrub matched the account name fromid -unas a bare substring, so any word containing it — and a public GitHub handle that begins with it — blocked a clean post. It fails closed, so nothing leaked, but a gate that routinely blocks harmless text teaches whoever runs it to work around it.or another regex metacharacter matches only itselfTest plan
markdownlint-cliwith the repository's.markdown-lint.ymlpasses ondoc-review.mdjohn.doeis matched in a path and the look-alikejohnxdoeis notlintpasses