Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Harden installer extraction and demo workflow inputs

rcourtman2c51890d0132
diff --git a/.github/workflows/deploy-demo-server.yml b/.github/workflows/deploy-demo-server.yml
index 78f5c070a6..1018903291 100644
--- a/.github/workflows/deploy-demo-server.yml
+++ b/.github/workflows/deploy-demo-server.yml
@@ -27,9 +27,11 @@ jobs:
steps:
- name: Resolve demo target environment
id: target
+ env:
+ INPUT_TARGET: ${{ inputs.target }}
run: |
set -euo pipefail
- TARGET="${{ inputs.target }}"
+ TARGET="$INPUT_TARGET"
case "$TARGET" in
stable)
ENVIRONMENT_NAME="demo-stable"
diff --git a/.github/workflows/update-demo-server.yml b/.github/workflows/update-demo-server.yml
index c1f49ad7cd..3e231c5c41 100644
--- a/.github/workflows/update-demo-server.yml
+++ b/.github/workflows/update-demo-server.yml
@@ -34,14 +34,19 @@ jobs:
steps:
- name: Resolve target tag and demo environment
id: target
+ env:
+ EVENT_NAME: ${{ github.event_name }}
+ INPUT_TAG: ${{ inputs.tag }}
+ INPUT_TARGET: ${{ inputs.target }}
+ RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
set -euo pipefail
- if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
- TAG="${{ inputs.tag }}"
- REQUESTED_TARGET="${{ inputs.target }}"
+ if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
+ TAG="$INPUT_TAG"
+ REQUESTED_TARGET="$INPUT_TARGET"
else
- TAG="${{ github.event.release.tag_name }}"
+ TAG="$RELEASE_TAG"
REQUESTED_TARGET="auto"
fi
diff --git a/install.sh b/install.sh
index 275ba8ad27..22c6b0ea98 100755
--- a/install.sh
+++ b/install.sh
@@ -2574,11 +2574,14 @@ detect_pulse_architecture() {
find_pulse_binary_in_dir() {
local dir="$1"
- if [[ -f "$dir/bin/pulse" ]]; then
+ # Reject symlinks: a malicious archive could place a symlink at the
+ # expected binary path pointing at an arbitrary file outside the
+ # extract directory, which would then be cp'd to $INSTALL_DIR/bin/pulse.
+ if [[ -f "$dir/bin/pulse" && ! -L "$dir/bin/pulse" ]]; then
printf '%s\n' "$dir/bin/pulse"
return 0
fi
- if [[ -f "$dir/pulse" ]]; then
+ if [[ -f "$dir/pulse" && ! -L "$dir/pulse" ]]; then
printf '%s\n' "$dir/pulse"
return 0
fi
@@ -2824,7 +2827,9 @@ install_pulse_archive() {
fi
temp_extract=$(mktemp -d /tmp/pulse-extract-XXXXXX)
- if ! tar -xzf "$archive_path" -C "$temp_extract"; then
+ # --no-same-owner: do not honor uid/gid stored in the archive (extract as root, owned by root)
+ # --no-overwrite-dir: refuse to replace existing directory metadata with archive entries
+ if ! tar --no-same-owner --no-overwrite-dir -xzf "$archive_path" -C "$temp_extract"; then
print_error "Failed to extract Pulse release archive"
rm -rf "$temp_extract"
return 1
@@ -2893,7 +2898,7 @@ install_pulse_archive() {
rm -f "$INSTALL_DIR/bin/pulse"
temp_extract2=$(mktemp -d /tmp/pulse-extract2-XXXXXX)
- if ! tar -xzf "$archive_path" -C "$temp_extract2"; then
+ if ! tar --no-same-owner --no-overwrite-dir -xzf "$archive_path" -C "$temp_extract2"; then
print_warn "Failed to re-extract archive for version verification retry"
else
pulse_binary_path=$(find_pulse_binary_in_dir "$temp_extract2" 2>/dev/null || true)