Skip to content

Commit dd8ac74

Browse files
authored
fix: upgrade handlebars to 4.7.9, fix pre-push hook (#1134)
* fix: upgrade handlebars to 4.7.9 (6 CVEs) Addresses all 6 open Dependabot alerts: - CVE-2026-33937 (critical): JS Injection via AST Type Confusion - CVE-2026-33941 (high): JS Injection in CLI Precompiler - CVE-2026-33940 (high): JS Injection via AST Type Confusion (dynamic partial) - CVE-2026-33939 (high): DoS via Malformed Decorator Syntax - CVE-2026-33938 (high): JS Injection via AST Type Confusion (@partial-block) - CVE-2026-33916 (medium): Prototype Pollution Leading to XSS * fix: pre-push hook checks commits already on remote For new branches, compare against remote default branch instead of searching for release tags. The tag-based approach included commits already on origin/main, causing false positives for AI attribution. * fix: add fallback when remote default branch ref is missing in pre-push hook
1 parent 8760522 commit dd8ac74

3 files changed

Lines changed: 15 additions & 12 deletions

File tree

.husky/pre-push

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ TOTAL_ERRORS=0
2626
while read local_ref local_sha remote_ref remote_sha; do
2727
# Get the range of commits being pushed.
2828
if [ "$remote_sha" = "0000000000000000000000000000000000000000" ]; then
29-
# New branch - find the latest published release tag to limit scope.
30-
latest_release=$(git tag --list 'v*' --sort=-version:refname --merged "$local_sha" | head -1)
31-
if [ -n "$latest_release" ]; then
32-
# Check commits since the latest published release.
33-
range="$latest_release..$local_sha"
29+
# New branch: only check commits not already on the remote default branch.
30+
default_branch=$(git symbolic-ref "refs/remotes/${remote}/HEAD" 2>/dev/null | sed "s|refs/remotes/${remote}/||")
31+
if [ -z "$default_branch" ]; then
32+
default_branch="main"
33+
fi
34+
# Verify the remote ref exists locally before using it in the range.
35+
if git rev-parse --verify "${remote}/${default_branch}" >/dev/null 2>&1; then
36+
range="${remote}/${default_branch}..$local_sha"
3437
else
35-
# No release tags found - check all commits.
38+
# Remote ref missing (shallow clone, --single-branch, etc.), check all commits.
3639
range="$local_sha"
3740
fi
3841
else

packages/package-builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"@socketsecurity/lib": "catalog:",
1919
"build-infra": "workspace:*",
20-
"handlebars": "^4.7.8"
20+
"handlebars": "^4.7.9"
2121
},
2222
"engines": {
2323
"node": ">=25.5.0"

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)