Stepping EOL Ubuntu 22.10 to 24.04.5 LTS: A Same-Day Field Walkthrough Patching PHP2Shell, Node2Shell, Java2Shell, NGINX, and Linux Kernel LPEs
End-of-life Linux workstations and self-hosted engineering servers rarely fail all at once—instead, they accumulate quiet layers of conflicting package pins, duplicate language shims, stale local repository mirrors, and unpatched kernel subsystems until a wave of critical disclosures arrives simultaneously. Here is our step-by-step field walkthrough taking a live workstation from end-of-life Ubuntu 22.10 onto Ubuntu 24.04.5 LTS and the Linux 7.0 HWE kernel, reclaiming 54 GB of disk bloat, compiling hardened mainline NGINX 1.31.10 from source, closing shadow-$PATH traps across PHP2Shell, Node2Shell, and Java2Shell, and locking down the Linux kernel Local Privilege Escalation (LPE) surface in one maintenance window.
- Part 1 — OS, Bloat & GPU Display Recovery: Bridging EOL Ubuntu Releases to 24.04 LTS, Reclaiming 54 GB & Fixing 0-Byte NVIDIA HDMI EDID Lockouts
- Part 2 — Hardened Source Edge Builds: Compiling Mainline NGINX 1.31.10 From Source With PIE, Full RELRO, HTTP/3 QUIC & APT Hold Guardrails
- Part 3 — Hunting Hidden User-Space Shims: Why apt upgrade Missed Your Vulnerable Runtimes: Eliminating Shadow-$PATH Shims Across PHP2Shell, Node2Shell & Java2Shell
- Part 4 — Kernel LPE & AppArmor Sandboxes: Hardening Linux Against the 948-Exploit LPE Wave: io_uring Lockdown, SUID Pruning & Scoped AppArmor userns Profiles
1. Stepping Past the Ubuntu EOL Upgrade Trap Without Breaking GPU or Database Workloads
Running do-release-upgrade -c on an unsupported non-LTS Ubuntu release such as 22.10 (Kinetic) prints a deceptive banner advertising 24.04.5 LTS directly. Because Ubuntu's release upgrader prohibits skipping intermediate non-LTS milestones, invoking the tool directly aborts as soon as the downloaded noble payload inspects the base codename. Reaching a five-year LTS baseline in place requires stepping through every archived milestone sequentially: 22.10 (kinetic) → 23.04 (lunar) → 23.10 (mantic) → 24.04.5 LTS (noble).
Three practical lessons stood out during the OS migration (covered in full detail in Part 1 of this series):
- Park Third-Party APT Sources & Priority-600 Pins Upfront: Vendor repositories pinned at priority
600(such as legacyubuntu2204NVIDIA CUDA pins, local cuDNN.debmirrors, and codename-locked Docker lists) stall APT dependency resolution across majorglibcand GCC jumps. Moving/etc/apt/sources.list.d/*and custom/etc/apt/preferences.d/pins into a backup directory allowed clean transitions acrossold-releases.ubuntu.comtarballs (lunar.tar.gzandmantic.tar.gz) beforenobleautomatically migrated mirrors back toarchive.ubuntu.com. - Reclaim Dormant Upgrade Bloat (54 GB Freed): Auditing disk consumers uncovered five forgotten local CUDA/cuDNN repo packages (
12.0 GB), 24 disabled Snap squashfs revisions (10.0 GB), unpinned systemd journals (4.0 GB), three unused desktop environments and extra display managers (7.0 GB), stale/usr/local/php*trees, four EOL NVM Node versions, and17.0 GBin~/.cache/pipand Gradle caches—all removable without touching active MariaDB schemas or CUDA 12.8 toolkits. - Diagnose Hardware 0-Byte HDMI EDID Lockouts Separately From GPU Drivers: When the upgraded desktop came up locked at
1600x900, switching fromnvidia-driver-580-server-opento the desktopnvidia-driver-595package improved driver hygiene, while inspecting/sys/class/drm/card1-HDMI-A-1/edidproved the HDMI link was returningedid_bytes=0—solved cleanly with an XorgModeValidationoverride and removing a stalevendor="???"entry inmonitors.xml.
# One-shot read-only pre-flight audit before starting an Ubuntu LTS migration
ls -la /etc/apt/sources.list.d/ /etc/apt/preferences.d/
df -h / /boot/efi && du -sh /var/cache/apt/archives /var/log/journal /var/lib/snapd/snaps 2>/dev/null
systemd-analyze && systemctl --failed --no-pager
2. Compiling Mainline NGINX 1.31.10 From Source With Full Binary Hardening
Teams needing the newest upstream HTTP/2 and HTTP/3 (QUIC) state-machine fixes ahead of distribution backport cycles often compile mainline NGINX from source—yet a naive ./configure && make produces an unhardened binary in /usr/local/nginx that bypasses systemd supervision and lacks OS exploit mitigations. In Part 2, we compiled upstream NGINX 1.31.10 directly over Ubuntu's exact layout (/usr/sbin/nginx, /etc/nginx/nginx.conf, /run/nginx.pid) with GCC 13 PIE, Full RELRO, -D_FORTIFY_SOURCE=3, stack-clash protection, and Intel CET (-fcf-protection), retired TLSv1 and TLSv1.1, set server_tokens off;, fixed world-writable 0777 permissions on /var/www/html, and locked apt-mark hold nginx nginx-common so unattended upgrades never revert the binary.
3. Why OS Patching Alone Misses Shadow-PATH Traps in PHP2Shell, Node2Shell, and Java2Shell
Even after Ubuntu 24.04.5 LTS finished installing every noble-security update, auditing the workstation with which -a exposed three vulnerable user-space runtimes sitting ahead of patched OS packages in $PATH (detailed in Part 3):
- PHP2Shell (CVE-2026-109618 & CVE-2026-109619): Ubuntu's
php8.3(8.3.6-0ubuntu0.24.04.14) already compiled inCVE-2026-109618_109619.patchand disabledsession.upload_progress.enabled, yet~/.config/herd-lite/bin/phpwas serving an unpatched 2024PHP 8.4.1static binary first in$PATH, while/usr/local/php/bin/phpowned/etc/alternatives/php. - Node2Shell (CVE-2026-111497): NVM was still pinned to
v22.12.0(plus dormantv10–v16directories), leaving local CLI package managers and fetch pipelines decoding HTTPS Brotli streams through the vulnerablenode:zlibC library until we promoted NVM to Node.js v22.23.5. - Java2Shell / Java4Shell (CVE-2026-114938): While
/proc/cpuinfoconfirmed the workstation's processor lackedavx512_vbmi(preventing the HotSpot Base64 C2 intrinsic overflow) and Ubuntu'sopenjdk-21-jre(21.0.13.1+2) was patched, an orphaned Oraclejdk-23package (EOL since March 2025) still controlled/usr/bin/javaand/usr/bin/javacuntil replaced withopenjdk-21-jdk.
4. Hardening the Linux Kernel Against the 948-Exploit LPE Wave
Following November 2026's autonomous kernel audit demonstrating 948 reproducible Local Privilege Escalation exploits across complex kernel subsystems, we promoted the host onto the Linux 7.0 HWE kernel (7.0.0-43-generic) and closed the remaining LPE attack surface without breaking desktop developer tools (Part 4):
- Scoped AppArmor
usernsProfiles Over Global Sysctl Rollbacks: When Ubuntu 24.04'skernel.apparmor_restrict_unprivileged_userns = 1blocked a desktop Electron IDE from spawning its Chromium sandbox, we wrote a targeted/etc/apparmor.d/profile grantinguserns,strictly to that binary path rather than disabling userns protection system-wide. - Sysctl & SUID Lockdown: Enforced
kernel.io_uring_disabled = 2,dev.tty.ldisc_autoload = 0,net.core.bpf_jit_harden = 2, andkernel.kptr_restrict = 2in/etc/sysctl.d/99-lpe-hardening.conf, purged unused SUID screensaver helpers (xscreensaver-auth), removed a dead legacy Snort daemon sniffing an unplugged NIC, and eliminated a 2-minute boot stall insystemd-networkd-wait-online.service.
5. Complete Before-and-After Remediation Matrix
| Control Area | Starting State Discovered | Verified Hardened State |
|---|---|---|
| OS & Kernel Baseline | EOL Ubuntu 22.10 on Linux 5.19 (unpatched since Jul 2023) |
Ubuntu 24.04.5 LTS + Linux 7.0.0-43 HWE (Prompt=lts) |
| Disk & Service Hygiene | 54 GB stale CUDA/Snap/pip caches, 3 extra DEs, 2m52s boot stall | 54 GB freed, Cinnamon 6.0 + GDM3 only, ~48s clean boot |
| NGINX Edge Proxy | Distro 1.24.0, TLSv1/1.1 active, 0777 webroot |
Source NGINX 1.31.10 (PIE + Full RELRO + FORTIFY=3), TLSv1.2/1.3, 0755 |
PHP2Shell (CVE-2026-109618/19) |
Shadow 8.4.1 binary in ~/.config/herd-lite + /usr/local/php* |
Patched Ubuntu php8.3 (8.3.6-0ubuntu0.24.04.14) across $PATH |
Node2Shell (CVE-2026-111497) |
NVM v22.12.0 + EOL v10–v16 (vulnerable Brotli node:zlib) |
Patched Node.js v22.23.5 LTS; all legacy NVM trees purged |
Java2Shell (CVE-2026-114938) |
EOL Oracle jdk-23 (23.0.2) owning /usr/bin/java |
Patched OpenJDK 21.0.13.1+2 across java & javac |
| Kernel LPE Surface | io_uring_disabled=0, ldisc_autoload=1, extra SUID helpers |
io_uring_disabled=2, ldisc_autoload=0, bpf_jit_harden=2, scoped AppArmor |
Questions From Teams Planning Similar Linux Catch-Up Windows
In what order should we tackle an overdue Linux host that has both EOL OS debt and active runtime CVEs?
Back up databases and home directories first, park third-party APT sources so sequential release hops reach a supported LTS repository cleanly, and verify kernel/DKMS boot health. Once APT is pulling live LTS security updates, sweep which -a for shadow user-space binaries in ~/.nvm, ~/.config, and /usr/local before locking down kernel sysctl and AppArmor profiles.
Why check Debian/Ubuntu package changelogs instead of relying solely on php -v or java -version numbers?
Ubuntu and Debian backport upstream security patches into stable feature versions—for example, Ubuntu's 8.3.6-0ubuntu0.24.04.14 carries the full CVE-2026-109618_109619.patch even though the upstream base string still reads 8.3.6. Inspecting changelog.Debian.gz prevents false-positive panic on distro packages while focusing effort on genuinely unpatched third-party shims.
Can we apply the kernel LPE sysctl drop-in on Ubuntu 22.04 or Debian 12 hosts before upgrading to 24.04 LTS?
Yes. Directives such as kernel.io_uring_disabled = 2 (Linux 6.6+ and backported vendor kernels), dev.tty.ldisc_autoload = 0, kernel.unprivileged_bpf_disabled = 2, net.core.bpf_jit_harden = 2, and kernel.kptr_restrict = 2 apply immediately via sysctl --system while you schedule your full LTS maintenance window.
Want a Calm, Scoped Hardening Review for Your Linux Servers or Developer Workstations?
We help engineering and small-business teams retire end-of-life OS debt, uncover shadow runtime shims, and lock down kernel LPE surfaces without disrupting active projects.
INTERACTIVE LINUX KERNEL LPE & SHADOW-$PATH LAB
Evaluate kernel LPE sysctls & user-space $PATH shims
Toggle your Ubuntu kernel/AppArmor posture and io_uring + $PATH shim state to preview privilege-escalation exposure and copy a one-shot audit & lockdown snippet.
Unrestricted io_uring rings, global userns rollbacks, or forgotten ~/.nvm and herd-lite binaries leave local root escalation and *2Shell paths reachable.
which -a php node java javac
sudo sysctl kernel.io_uring_disabled kernel.apparmor_restrict_unprivileged_userns dev.tty.ldisc_autoload