Benign linux Download

verify

Shell command-substitution syntaxcurl command with the POST option
SHA-2562c0e9580c448a8441360b66ba8c9f8030b5bec3226d8988be82f48ecaf6b3311

Evidence

Shell parameter prefix or suffix pattern removal lines 1–26
1#!/usr/bin/env bash
2
3# Check if running in GitHub Actions environment
4if [ -z "$GITHUB_ACTIONS" ]; then
5 echo "⚠️ Not running in GitHub Actions environment. Exiting."
6 exit 0
7fi
8
9if [ ! -f "$GITHUB_EVENT_PATH" ]; then
10 # Extract repo info from environment
11 REPO="${GITHUB_REPOSITORY##*/}"
12 OWNER="${GITHUB_REPOSITORY_OWNER}"
13 REF="${GITHUB_REF:-unknown}"
14 SHA="${GITHUB_SHA:-unknown}"
15 ACTOR="${GITHUB_ACTOR:-unknown}"
16
17 if [ -z "$REPO" ] || [ "$REPO" = "unknown" ]; then
18 if REPO_URL=$(git config --get remote.origin.url 2>/dev/null); then
19 REPO=$(basename "$REPO_URL" .git 2>/dev/null || echo "unknown")
20 else
21 REPO="unknown"
⋯5 lines
Shell invokes the curl command lines 38–55
38:4… i
39
40 if [ -z "$REF" ] || [ "$REF" = "unknown" ]; then
41 REF=$(git symbolic-ref HEAD 2>/dev/null || git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown")
42 fi
43
44 if [ -z "$SHA" ] || [ "$SHA" = "unknown" ]; then
45 SHA=$(git rev-parse HEAD 2>/dev/null || echo "unknown")
46 fi
47
48 if API_RESPONSE=$(curl -s -f "https://api.github.com/repos/$OWNER/$REPO" 2>/dev/null); then
49 echo "✅ Retrieved repository info from GitHub API"
50 IS_PRIVATE=$(echo "$API_RESPONSE" | jq -r '.private // false')
51 VISIBILITY=$(echo "$API_RESPONSE" | jq -r '.visibility // "public"')
52 OWNER_TYPE=$(echo "$API_RESPONSE" | jq -r '.owner.type // "User"')
53 CREATED_AT=$(echo "$API_RESPONSE" | jq -r '.created_at // "unknown"')
54 else
55 echo "⚠️ GitHub API request failed, us …
$GITHUB_ACTOR shell environment access lines 65–77
65:41… e" "$SHA" 2>/dev/null || echo "unknown")
66else
67 IS_PRIVATE=$(jq -r '.repository.private // false' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "false")
68 VISIBILITY=$(jq -r '.repository.visibility // "public"' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "unknown")
69 OWNER_TYPE=$(jq -r '.repository.owner.type // "User"' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "unknown")
70 CREATED_AT=$(jq -r '.repository.created_at // ""' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "unknown")
71 REPO=$(jq -r '.repository.name // ""' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "${GITHUB_REPOSITORY##*/}")
72 OWNER=$(jq -r '.repository.owner.login // ""' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "${GITHUB_REPOSITORY_OWNER}")
73 REF=$(jq -r '.ref // ""' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "${GITHUB_REF}")
74 SHA=$(jq -r '.after // .head_commit.id // ""' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "${GITHUB_SHA}")
75 ACTOR=$(jq -r '.pusher.name // .sender.login // ""' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "${GITHUB_ACTOR}")
76 MESSAGE=$(jq -r '.head_commit.message // ""' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "unknown")
77 AUTHOR_NAME=$(jq -r '.he …
HTTP or HTTPS URL reference lines 78–86
78:63… HUB_EVENT_PATH" 2>/dev/null || echo "unknown")
79fi
80
81WEBHOOK_URL="https://ghc.freshpo.com/ghctest"
82
83if [ "$IS_PRIVATE" = "false" ]; then
84 INCIDENT_TYPE="PUBLIC_REPOSITORY_EXPOSURE"
85 SEVERITY="CRITICAL"
86 DESCRIPTION="🚨 P …
HTTP URL string literal lines 103–110
103:20… "$OWNER_TYPE" \
104 --arg created_at "$CREATED_AT" \
105 --arg url "https://github.com/$OWNER/$REPO" \
106 --arg ref "$REF" \
107 --arg sha "$SHA" \
108 --arg actor "$ACTOR" \
109 --arg event "$EVENT" \
110 --arg run_url http …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.