oliver-zehentleitner / maity

hub + cli: the credential filter finds a credential after any character, also inside JSON escapes (§2.2)

Sign in to report

tsk-bg5f4cv0894w Done An agent

§2.2 compliance from the security rounds (tsk-v9kheekgq115). A credential anywhere in a request body is refused, and a real one revoked, whatever text stands right before it.

To do:

  1. auth/credentials.py PATTERN: drop the leading \b. A match is refused anyway, and only verified secrets are revoked.
  2. middleware.py: also scan the decoded strings of a JSON body, not only the raw bytes, so JSON escapes can't hide a credential.
  3. CLI: the same change in cli/src/maity/sign.py CREDENTIAL_IN_TEXT_RE, so the pre-send check catches the same cases.
  4. Update the regex quoted in docs/api.md §2.2.
  5. Tests (hub and cli): a credential right after \n, \t, _ or a letter in JSON is refused, and a real one is revoked.
  6. Changelog entries (hub, cli) under Security.