Skip to content

Commit ff63b25

Browse files
committed
fix: patch dependency vulnerabilities and deploy migration bug
Update filament, laravel/framework, dompdf, guzzle/psr7, league/commonmark, phpseclib, and sodium_compat to versions patching GitHub-flagged advisories (MFA recovery code reuse, unauthenticated temp file upload, XSS, CRLF injection, SSRF, DoS). Apply equivalent npm audit fixes. Fix deploy.yml: RUN_MIGRATIONS/RUN_SCOUT_IMPORT were escaped inside the SSH heredoc, so they evaluated on the remote shell where they're never set — migrations silently never ran on deploy regardless of the workflow input. Add npm audit to CI security job and a CodeQL workflow (previously no code scanning was configured for the repo).
1 parent 3cd3c9e commit ff63b25

26 files changed

Lines changed: 1224 additions & 900 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,17 @@ jobs:
158158
- name: Install dependencies
159159
run: composer install --prefer-dist --no-interaction --no-progress --no-scripts
160160

161-
- name: Run security audit
161+
- name: Run PHP security audit
162162
run: composer audit --no-dev
163+
164+
- name: Setup Node.js
165+
uses: actions/setup-node@v4
166+
with:
167+
node-version: "20"
168+
cache: "npm"
169+
170+
- name: Install Node dependencies
171+
run: npm ci
172+
173+
- name: Run npm security audit
174+
run: npm audit --audit-level=high

.github/workflows/codeql.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: "17 3 * * 1"
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write
17+
contents: read
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
language: [php, javascript-typescript]
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Initialize CodeQL
29+
uses: github/codeql-action/init@v3
30+
with:
31+
languages: ${{ matrix.language }}
32+
33+
- name: Perform CodeQL analysis
34+
uses: github/codeql-action/analyze@v3
35+
with:
36+
category: "/language:${{ matrix.language }}"

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@ jobs:
150150
\$PHP artisan view:cache
151151
\$PHP artisan event:cache
152152
153-
if [ "\$RUN_MIGRATIONS" = "true" ]; then
153+
if [ "$RUN_MIGRATIONS" = "true" ]; then
154154
echo "==> Running database migrations"
155155
\$PHP artisan migrate --force
156156
fi
157157
158158
echo "==> Restarting queue workers"
159159
\$PHP artisan queue:restart
160160
161-
if [ "\$RUN_SCOUT_IMPORT" = "true" ]; then
161+
if [ "$RUN_SCOUT_IMPORT" = "true" ]; then
162162
echo "==> Re-indexing Typesense"
163163
\$PHP artisan scout:flush "App\Domain\Product\Models\Product"
164164
\$PHP artisan scout:import "App\Domain\Product\Models\Product"

0 commit comments

Comments
 (0)