Skip to content

Commit 0cfc181

Browse files
sunny-seclaude
andcommitted
fix(security): remove insecure self-update from spm.sh scripts
F-006 / DEVA11Y-478 — script_self_update() in spm.sh scripts fetched from a mutable branch head with no integrity verification (CWE-494). Same pattern as F-003. Remove self-update entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0428b32 commit 0cfc181

3 files changed

Lines changed: 0 additions & 30 deletions

File tree

scripts/bash/spm.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,6 @@ EOF
8383
scan $EXTRA_ARGS
8484
}
8585

86-
script_self_update() {
87-
local remote_url="https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/bash/spm.sh"
88-
89-
updated_script=$(curl -R -z "$SCRIPT_PATH" "$remote_url")
90-
if [[ $updated_script =~ ^#! ]]; then
91-
echo "$updated_script" > "$SCRIPT_PATH"
92-
fi
93-
}
94-
95-
script_self_update
9686
if [[ $SUBCOMMAND == "register-pre-commit-hook" ]]; then
9787
register_git_hook
9888
exit 0

scripts/fish/spm.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,6 @@ EOF
9696
scan $EXTRA_ARGS
9797
}
9898

99-
script_self_update() {
100-
local remote_url="https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/fish/spm.sh"
101-
102-
updated_script=$(curl -R -z "$SCRIPT_PATH" "$remote_url")
103-
if [[ $updated_script =~ ^#! ]]; then
104-
echo "$updated_script" > "$SCRIPT_PATH"
105-
fi
106-
}
107-
108-
script_self_update
10999
if [[ $SUBCOMMAND == "register-pre-commit-hook" ]]; then
110100
register_git_hook
111101
exit 0

scripts/zsh/spm.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,6 @@ EOF
9595
scan $EXTRA_ARGS
9696
}
9797

98-
script_self_update() {
99-
local remote_url="https://raw.githubusercontent.com/browserstack/AccessibilityDevTools/refs/heads/main/scripts/zsh/spm.sh"
100-
101-
updated_script=$(curl -R -z "$SCRIPT_PATH" "$remote_url")
102-
if [[ $updated_script =~ ^#! ]]; then
103-
echo "$updated_script" > "$SCRIPT_PATH"
104-
fi
105-
}
106-
107-
script_self_update
10898
if [[ $SUBCOMMAND == "register-pre-commit-hook" ]]; then
10999
register_git_hook
110100
exit 0

0 commit comments

Comments
 (0)