wrolpi/modules/repos
Roland 5506dc0a88
repos: harden README search against untrusted READMEs
A README comes from an untrusted remote.

* Escape the README headline: snippet() marks matches with control
  characters, the text is HTML-escaped, then the markers become <b>.
  Headlines are rendered as HTML (HeadlineText).
* Never follow a symlinked README (O_NOFOLLOW, regular files only).
* Convert markdown line by line with linear-time patterns.  The old
  multiline patterns backtracked polynomially; a README of blank lines
  never finished, and runs of `<!--`, `![` or `<` were quadratic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:56:09 -06:00
..
test repos: harden README search against untrusted READMEs 2026-10-06 16:56:09 -06:00
__init__.py Add a Repos module that mirrors git repositories (backend) 2026-10-06 16:56:09 -06:00
api.py repos: search Repos by name and README 2026-10-06 16:56:09 -06:00
conftest.py Add a Repos module that mirrors git repositories (backend) 2026-10-06 16:56:09 -06:00
downloader.py repos: search Repos by name and README 2026-10-06 16:56:09 -06:00
errors.py Add a Repos module that mirrors git repositories (backend) 2026-10-06 16:56:09 -06:00
lib.py repos: harden README search against untrusted READMEs 2026-10-06 16:56:09 -06:00
models.py repos: search Repos by name and README 2026-10-06 16:56:09 -06:00
schema.py repos: search Repos by name and README 2026-10-06 16:56:09 -06:00