Eleven security fixes across five apps · Oct 2024 – Oct 2026
Two years of security fixes across five apps
Security work on a frontend is rarely one big fix. It’s a steady stream of alerts, most of them in code nobody on the team wrote. Over two years I handled eleven of them across five apps, and each taught me something different about where vulnerabilities hide and what a real fix looks like.
- Role
- Frontend engineer
- When
- Oct 2024 – Oct 2026
- Where
- PayGlocal
- Stack
- npmNext.jsnginxDockerDependabot
The situation
Our apps share the same exposure as most JavaScript apps: hundreds of packages, most of them pulled in by other packages, plus a web server and a build tool that sit outside “the code”. Alerts arrive from Dependabot, security tickets and vulnerability assessments. Some apply directly, some only on a server, some can’t be fixed by upgrading at all. Treating them all as “bump the version” would have missed half of them.
What I built
- Patched an HTML sanitiser with a published XSS bypass, then removed it from the checkout altogether.
- Forced fixes for packages we never installed directly, first by pinning, later with npm overrides.
- Moved a Next.js dashboard through a December 2025 run of Server Components advisories, and checked that the lockfile resolved to the release with the complete fix.
- Upgraded an HTTP client in steps and sorted its advisories into ones that affect a browser app and ones that only matter on a server.
- Switched the console’s nginx to the vendor’s mainline repository, pinned it, and made the Docker build fail on an older version.
- Migrated an app off an unmaintained build tool whose alerts couldn’t be fixed in place (on a branch, awaiting testing).
- Pinned both checkouts to one reviewed lockfile and one private registry, and added username allowlists to sensitive finance pages.
Every fix, by where it lived
- HTML sanitiser with an XSS bypass
Patched DOMPurify 3.1.0 → 3.1.3 (CVE-2024-45801).
What I learned → - The same sanitiser, gone
Removed DOMPurify entirely during the bundle work. Its future advisories no longer apply.
What I learned → - Versions drifting between apps and registries
Pinned dependencies to one reviewed lockfile, installed from a single private registry.
- Predictable multipart boundaries, deep in the tree
Forced form-data ≥ 4.0.4 under axios (CVE-2025-7783).
What I learned → - Server Components: denial of service and source exposure
Next.js 15.5.7 → 15.5.9, the release with the complete fix (CVE-2025-55184, -55183, -67779).
What I learned → - Alerts in an unmaintained build tool
Migrated Create React App to Rsbuild and React 18 on a branch, awaiting full testing.
What I learned → - An audit gate that blocked everyone
Narrowed npm audit to high and production, then took it out of pre-commit. It belongs in CI.
What I learned → - HTTP client advisories
axios 1.7.9 → 1.16.0 in steps, with follow-redirects (e.g. CVE-2025-27152).
What I learned → - nginx lagging behind its fixes
Installed from nginx’s mainline repository, pinned, and made the build fail on older versions.
What I learned → - A batch of framework and image-library alerts
Next.js 15.5.18 → 15.5.22, postcss, and overrides for sharp and brace-expansion.
What I learned → - Finance pages open to anyone with the role
Per-environment username allowlists on top of permissions, carried over from the legacy tool.
Decisions
Remove before you patch
Every package is a subscription to its future advisories. When an alert arrives, the first question is whether the code still needs to exist. Deleting the sanitiser closed that line of alerts for good.
Trust the lockfile, not the manifest
The manifest says what you’ll accept; the lockfile says what runs. After every security bump I check the resolved version against the advisory’s fixed list.
Turn “we’re on a safe version” into a build failure
The web server isn’t in package.json, so nothing flagged it. A version check in the build makes an old nginx impossible to ship silently.
Put gates where they judge the change
An npm audit in pre-commit failed on new advisories, not on what people changed, so it got switched off. Audits belong on a schedule and in CI on dependency changes.
Outcome
| What | Before | After | Detail |
|---|---|---|---|
| Security fixes | 11 | across 5 apps | |
| Layers involved | 7 | not just npm | |
| Write-ups | 7 | one per lesson | |