Commit Graph
9 Commits
Author SHA1 Message Date
Martin Vogel 331a581551 docs(post-release): align README, server.json, package wrappers with v0.6.1
- README badges: languages 66->155, agents 10->11, tests 2586->2812 (actual count from v0.6.1 test run)
- README: VirusTotal table, primary VT badge link, all '66 languages' references, expanded language list with all newly added grammars
- server.json: bump 0.5.5->0.6.1 (was two releases behind), update all download URLs and sha256s
- pkg/scoop, homebrew, aur, chocolatey, winget: bump to 0.6.1 with new sha256s from v0.6.1 checksums.txt
- pkg/winget: new 0.6.1/ manifest directory (winget keeps version history; 0.6.0/ retained)
- pkg/npm/README: language and agent counts
2026-05-05 00:44:35 +02:00
Martin Vogel 4cdc2dc9f3 feat(release): auto-publish npm and PyPI wrappers
Add publish-registries job to release.yml that runs after verify
(release published, VirusTotal table appended). Publishes:

- pkg/npm via 'npm publish --access public --provenance'
- pkg/pypi via 'twine upload' (sdist + wheel from hatchling)

Both wrappers fetch the binary at install time, so a version bump is
the only per-release change needed. Bumped to 0.6.1.

Requires NPM_TOKEN and PYPI_TOKEN repo secrets.
2026-05-04 23:17:51 +02:00
Martin Vogel c1eb3dd2d1 Comprehensive security hardening across all installers
install.sh:
- Wrap entire body in main() to prevent partial execution from curl|bash
  (interrupted download would execute truncated script)

install.ps1:
- Enforce TLS 1.2+ (older PowerShell defaults to TLS 1.0)

PyPI (_cli.py):
- Add SHA256 checksum verification against checksums.txt (was the only
  installer without checksums)

npm (install.js):
- Add SHA256 checksum verification against checksums.txt
- Validate HTTPS on every redirect hop (max 5 redirects)
- Replace execSync string interpolation with execFileSync array args
  (eliminates shell injection vector in tar/PowerShell calls)
- Add path traversal check on extracted binary

npm (bin.js):
- Auto-download binary if missing (handles --ignore-scripts / pnpm)

Go wrapper (main.go):
- Custom HTTP client with CheckRedirect that rejects non-HTTPS redirects
  (Go's default http.Get follows redirects without scheme validation)
- Fix variable name bug in error message (url → rawURL)
2026-04-14 21:00:42 +02:00
Martin Vogel ce20ff9bbe Harden npm installer: checksum verification, HTTPS-only redirects, no shell injection
- Add SHA256 checksum verification against checksums.txt (was missing,
  all other installers had it)
- Validate URL scheme on every redirect hop (HTTPS-only, max 5 redirects)
- Replace execSync string interpolation with execFileSync array args
  (eliminates shell injection vector)
- Add path traversal check on extracted binary (tar-slip defense)
2026-04-14 20:51:18 +02:00
Martin Vogel a89bf96382 Harden installers: remove Unblock-File, add HTTPS-only URL validation
install.ps1:
- Remove both Unblock-File calls (Defender ClickFix.R!ml signal)
- Remove ExecutionPolicy ByPass from usage comment (scanned by Defender)
- Add HTTPS-only URL scheme check on CBM_DOWNLOAD_URL

install.sh:
- Add HTTPS-only URL scheme check on CBM_DOWNLOAD_URL

pkg/go wrapper:
- Add validateURLScheme() to httpGet and fetchChecksums (defense-in-depth,
  matching Python wrapper's _validate_url_scheme from PR #248)

All installers now allow localhost/127.0.0.1 for testing but reject
http://, ftp://, file:// and other schemes.
2026-04-14 20:44:17 +02:00
Dustin c552db6447 fix: harden PyPI installer against tar-slip and scheme attacks (#246)
Closes #246.

Three security improvements to pkg/pypi/src/codebase_memory_mcp/_cli.py:

1. tar-slip mitigation (S202) — the previous `tf.extractall(tmp)` /
   `zf.extractall(tmp)` calls trusted the archive not to contain absolute
   paths or `..` components. Replaced with _safe_extract_tar and
   _safe_extract_zip:
   - On Python 3.12+, tarfile uses the new `filter='data'` (PEP 706).
   - On Python 3.8–3.11 and for zipfile (no built-in filter), each member
     path is validated against the destination via os.path.abspath checks;
     symlinks and hardlinks in tarballs are rejected outright.

2. URL scheme allowlist (S310) — _validate_url_scheme rejects anything
   that isn't https before urlretrieve runs. The URL is constructed from
   hardcoded constants today, but this is a cheap defense-in-depth check
   against future config sources, redirects, or typos.

3. Justified noqa suppressions on the exec path — os.execv and
   subprocess.run receive args as a list (not a shell string) and neither
   uses shell=True, so there is no injection vector. Comments document
   the invariant so future changes don't reintroduce a shell form.

Verification:
- `ruff check _cli.py --select S` — passes (was 5 findings, now 0)
- Syntax check passes under Python 3.14
- Behavior preserved: download/extract/exec flow is unchanged on happy path
- New failure modes: clear `sys.exit` with actionable message when a
  malicious member path or non-https URL is detected

No new dependencies; all changes stdlib-only and compatible with the
project's declared `requires-python = ">=3.8"`.
2026-04-12 23:52:46 -07:00
DeusData aa0864d0bd Add README and fix files list for npm package
Adds a README.md to pkg/npm so the npmjs.com package page shows
documentation. Updates the files list in package.json to include it.
Will be published with the next version bump.
2026-04-12 18:29:10 +01:00
DeusData 39901769fd Add pkg/go — Go module wrapper for go install distribution
Adds a thin Go wrapper at pkg/go/cmd/codebase-memory-mcp that detects
the current platform and architecture, downloads the matching pre-built
binary from GitHub Releases, verifies its SHA-256 checksum, caches it,
and replaces the current process via exec.

Install via:
  go install github.com/DeusData/codebase-memory-mcp/pkg/go/cmd/codebase-memory-mcp@latest

The Go module proxy indexes this automatically once live on main.
2026-04-12 18:28:29 +01:00
DeusData 592be8ea42 Add pkg/ — distribution wrappers for npm, PyPI, Homebrew, Scoop, Winget, Chocolatey, AUR
Introduces pkg/ as a self-contained home for all package registry wrappers.
Each subdirectory is a ready-to-publish package that downloads the appropriate
pre-built binary from GitHub Releases — no source compilation at install time.

- pkg/npm/          — postinstall downloads binary; bin.js shim for CLI
- pkg/pypi/         — lazy download on first run via _cli.py; pipx-friendly
- pkg/homebrew/     — multi-arch formula (darwin/linux × arm64/amd64)
- pkg/scoop/        — Windows bucket manifest with autoupdate + checksum
- pkg/winget/       — v1.6.0 manifests (version + installer + locale)
- pkg/chocolatey/   — nuspec + install/uninstall scripts
- pkg/aur/          — PKGBUILD + .SRCINFO for x86_64 and aarch64

All hashes are real SHA-256 checksums from the v0.6.0 release.
2026-04-12 17:54:53 +01:00