Skip to content

chore: port upstream changes#12

Merged
babblebey merged 5 commits into
betafrom
feat/imp
Jul 20, 2026
Merged

chore: port upstream changes#12
babblebey merged 5 commits into
betafrom
feat/imp

Conversation

@babblebey

Copy link
Copy Markdown
Member

This pull request introduces several important security and feature improvements, primarily focused on preventing argument injection vulnerabilities in git operations, enhancing sensitive information masking, and expanding logger functionality. It also adds comprehensive tests to ensure these changes are robust.

Security and Input Validation Improvements:

  • All git commands that accept a repositoryUrl now explicitly separate options from positional arguments by inserting --, preventing malicious URLs from being interpreted as git command-line options (e.g., --upload-pack or --receive-pack). (lib/git.js) [1] [2] [3] [4] [5] [6] [7] [8]
  • The verify function now rejects any repositoryUrl that starts with a dash (-), which could otherwise be interpreted as a command-line option by git, and returns a new EINVALIDREPOURL error. (lib/verify.js, lib/definitions/errors.js) [1] [2]

Sensitive Data Masking Enhancements:

  • The hide-sensitive logic now masks secrets in all encoded forms, including those embedded in git URLs (such as those generated by url.format()), and covers more edge cases with reserved characters. (lib/hide-sensitive.js, test/hide-sensitive.test.js) [1] [2] [3]

Logger and Test Suite Improvements:

  • The logger now supports three additional semantic-release style log levels: start, skip, and complete, and tests were added to verify their outputs. (lib/get-logger.js, test/get-logger.test.js, README.md) [1] [2] [3]
  • New and updated tests ensure that argument injection is prevented and that sensitive credentials are never leaked in logs, even in encoded or embedded forms. (test/git.test.js, test/integration.test.js, test/verify.test.js) [1] [2] [3]

These changes significantly harden the codebase against a class of command injection attacks, improve log hygiene, and expand logging features for better CI/CD observability.

babblebey and others added 3 commits July 17, 2026 17:44
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>

* fix: mask secrets in the exact form url.format() embeds them in git URLs

The authenticated repository URL is built with the legacy url.format(),
which encodes the auth field like encodeURIComponent() except that ":"
separators are kept as is. A GIT_CREDENTIALS value such as
"user:abc@def-secret" therefore appears as "user:abc%40def-secret" in a
failing git command, a form matched by neither the raw value, encodeURI(),
nor encodeURIComponent() candidates, and leaked unmasked.

Add the colon-preserving encoded form to the redaction candidates, assert
the unit tests against URLs built the same way get-git-auth-url.js builds
them, and add an integration test reproducing the leak end-to-end with a
git remote on a closed loopback port.

---------

Co-authored-by: Matt Travi <programmer@travi.org>
Co-authored-by: Semantic Release Bot <32174276+semantic-release-bot@users.noreply.github.com>
@babblebey
babblebey merged commit d51b706 into beta Jul 20, 2026
8 checks passed
@babblebey
babblebey deleted the feat/imp branch July 20, 2026 14:13
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0-beta.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant