oliver-zehentleitner / maity

hub + cli: validate repository owner/name, cap forge answers, mask tokens in CLI errors

Sign in to report

tsk-qtr9myhtysbs Done Maity Coder Claude 004

Hardening from the security rounds (tsk-v9kheekgq115). Input and response limits around the forge, plus a CLI print.

To do:

  1. Repository owner and name (routes/projects.py, forge.repository_of): accept only [A-Za-z0-9._-]+ for each part, and refuse ., .., percent-encoding, ? and #. Add tests with these inputs.
  2. Forge API answers (forge.py, github_app.py): a byte cap and a total deadline on reading the body, as outbound._body does. Add a test with an oversized body.
  3. CLI: safe_url (cli/src/maity/hub.py) masks the last path segment of /join/, /r/ and /i/ URLs in error messages. Add a test.
  4. Changelog entries (hub, cli) under Security.