llm-security/commands
Kjell Tore Guttormsen 35359b7d8c
fix(git-clone): accept HTTPS repo URLs on any host, not just GitHub
scanners/lib/git-clone.mjs accepted only github.com, so the README's
Forgejo example (and /security scan on any Forgejo, Codeberg or self-hosted
URL) failed validation; scan.md and plugin-audit.md also routed only
https://github.com/ to the clone path.

Chose generic HTTPS over adding one host to an allowlist because there is
no documented security reason for the host check. Read before choosing:
git log --follow (import + E12 only), the file's comments, CHANGELOG v2.4.0
("GitHub repo URL support", feature framing), security-hardening-guide §2
and §7 (the sandbox is the defence against filter/smudge drivers), and
review-2026-06-20, which lists "vsix-fetch (HTTPS host allowlist)" as a
protection but no host check for git-clone. What protects a clone is the
OS sandbox, GIT_SANDBOX_CONFIG and GIT_SANDBOX_ENV, for every host alike.

Measured: with GIT_SANDBOX_ENV, git reads 0 config lines outside a repo;
without it, osxkeychain comes from Xcode's system gitconfig. So no stored
credential is offered to an unknown host.

The shape stays strict: https only, no userinfo, host starts and ends
alphanumeric (no leading -), optional port, exactly owner/repo, no query
or fragment. SSH stays GitHub-only: ssh uses the user's own keys and
~/.ssh/config, which the git environment does not isolate.

Tests (red first): Forgejo and any-host accept 2 failing -> green; guards
for http, userinfo, leading -, extra path, query, ext:: and file:: and
non-GitHub SSH hold. The old "rejects non-GitHub URL" case still passes
(it has no owner/repo) and is renamed to say so. Regex timed linear
(< 1 ms at 200k chars). Live: a sandboxed clone of
https://git.fromaitochitta.com/open/llm-security.git exits 0 at 5208420,
cleaned up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 14:14:39 +02:00
..
audit.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
clean.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
dashboard.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
deep-scan.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
diff.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
harden.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
ide-scan.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
mcp-audit.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
mcp-baseline-reset.md feat(commands): E14 part 3 — /security mcp-baseline-reset slash command 2026-04-30 16:49:01 +02:00
mcp-inspect.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
plugin-audit.md fix(git-clone): accept HTTPS repo URLs on any host, not just GitHub 2026-09-22 14:14:39 +02:00
posture.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
pre-deploy.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
red-team.md refactor(agents): skill-scanner detection rules move to knowledge 2026-09-22 14:11:15 +02:00
registry.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
scan.md fix(git-clone): accept HTTPS repo URLs on any host, not just GitHub 2026-09-22 14:14:39 +02:00
security.md feat(commands): E14 part 3 — /security mcp-baseline-reset slash command 2026-04-30 16:49:01 +02:00
supply-check.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
threat-model.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00
watch.md chore(llm-security): v7.7.2 — language consistency pass 2026-05-19 06:47:44 +02:00