Skip to content

fix(security): validate untrusted values before git, fs and logs - #10

Merged
log0u7 merged 1 commit into
mainfrom
fix/security-validators
Sep 20, 2026
Merged

log0u7 merged 1 commit into
mainfrom
fix/security-validators

Conversation

@log0u7

@log0u7 log0u7 commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Summary

Closes the four injection/leak vectors of issue #9 with a warn + safe fallback contract (no hard throw): invalid values are logged at WARN and replaced by the safe default, nothing breaks, the degraded state is visible.

Type of change

  • fix (bug fix)
  • test

Related issue

Fixes #9

How was this tested?

  • make test-ci passes (206/206, +7 security tests)
  • make test-async passes (16/16)
  • Verified manually on Vim 9.1 / Ubuntu 24.04
  • New logic covered by a Vader test, written test-first

The injection was proven before the fix (documented in #9): a .gitmodules branch = --upload-pack=/tmp/pwned.sh passed through git pull origin '<branch>' --ff-only executed the script despite shell quoting (git 2.43). After the fix, the hostile value is refused at the read point, warns, and falls back to default branch resolution.

Validator Applied at
sanitize_branch .gitmodules branch read (update pull flow), git submodule add -b
validate_module_path s:remove_module pathspecs (covers remove + gc)
validate_dir_name dir option, dict + positional forms
sanitize_url / sanitize_cmd commit messages, REPO_NOT_FOUND errors, traces, sidebar

Checklist

  • Commits follow Conventional Commits (type(scope): subject)
  • README.md / doc/plugin_manager.txt / CHANGELOG.md updated if behavior changed
  • No new network call at startup (opt-in only, behind a g:plugin_manager_* flag defaulting to off)
  • Linux only, Vim 8.2 floor respected (no Vim 9+ features, guard v:version < 802 untouched)

Proven RCE: a .gitmodules branch value like --upload-pack=<cmd> is
parsed by git as an option despite shell quoting (demonstrated with
git 2.43, issue #9). Untrusted values are now validated with a
warn + safe fallback contract:

- sanitize_branch: .gitmodules branch read + submodule add -b
- validate_module_path: pathspecs for git rm / submodule deinit
- validate_dir_name: dir option clone/install targets
- sanitize_url/sanitize_cmd: userinfo stripped from commit messages,
  error messages, traces and sidebar output

Closes #9
@log0u7
log0u7 merged commit 7ec84b2 into main Sep 20, 2026
32 checks passed
@log0u7
log0u7 deleted the fix/security-validators branch September 20, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Security: option/pathspec injection via .gitmodules values, dir traversal, token leak

1 participant