Ubuntu · Boot & system hardening

Remove prelink

When it fails: prelink is installed. prelink rewrites system binaries and libraries, which defeats address randomization of libraries and breaks file integrity checks.

CB-UBU-BOOT-014lowactiveautomatedautomated fixprofile core

Description

prelink modifies ELF binaries and shared libraries in place so that libraries load at fixed, precomputed addresses, to save a little time at program start. It is in the universe component of Ubuntu up to 24.04 and is no longer in the archive from 26.04.

On 26.04 the package cannot be installed from the archive, so the check passes unless it came from another source.

Rationale

Prelinked libraries always load at the same address, which removes part of the benefit of address space layout randomization (CB-UBU-BOOT-001). Prelink also rewrites binaries on a schedule, so file integrity tools such as AIDE report changes that are not attacks, which trains administrators to ignore their alerts. The startup gain is negligible on current hardware.

Impact

None known. Before removal, the fix runs prelink -ua to restore every binary to its original content, which can take a few minutes on a large system.

Setting

LocationPackage `prelink`
DefaultNot installed
RecommendedNot installed

Audit

Run dpkg -s prelink. The package must not be installed.

Automated: every check must pass. Scanners report each check by its id.

package

The prelink package is not installed.

name: prelink
state: absent

Remediation

  1. Restore the original binaries: prelink -ua.
  2. Remove the package: apt purge prelink.
Restartnone
Disruptionlow

Rollback

Reinstall the package with apt install prelink; binaries are prelinked again at the next run of its daily job.

undo-and-purge

if command -v prelink >/dev/null 2>&1; then
  prelink -ua || { echo 'prelink -ua failed, package kept' >&2; exit 1; }
fi
DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Lock::Timeout=300 purge -y -q prelink

Handwritten code reads parameters from CB_<NAME> environment variables. Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.

References

Mappings

FrameworkIDRelation
NIST SP 800-53 Rev. 55.1.1CM-7related
NIST SP 800-53 Rev. 55.1.1SI-7related

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

Threats mitigated

People and lifecycle

Authors
Verified2026-10-19 by Sn0wAlice on 20.04, Proxmox VM, Ubuntu 20.04 cloud image, kernel 5.4.0-216-generic, BIOS boot. Passes on a fresh install; with prelink installed and run (prelink -avmR) it fails, the fix runs prelink -ua and purges the package, then it passes.
Verified2026-10-19 by Sn0wAlice on 22.04, Proxmox VM, Ubuntu 22.04 cloud image, kernel 5.15.0-198-generic, BIOS boot. Passes on a fresh install; with prelink installed and run (prelink -avmR) it fails, the fix runs prelink -ua and purges the package, then it passes.
Verified2026-10-19 by Sn0wAlice on 24.04, Proxmox VM, Ubuntu 24.04 cloud image, kernel 6.8.0-147-generic, BIOS boot. Passes on a fresh install; with prelink installed and run (prelink -avmR) it fails, the fix runs prelink -ua and purges the package, then it passes.
Verified2026-10-19 by Sn0wAlice on 26.04, Proxmox VM, Ubuntu 26.04 cloud image, kernel 7.0.0-38-generic, BIOS boot. Passes on a fresh install; prelink is not in the 26.04 archive.
Introduced inv0.1.0
Created, updated2026-10-19, 2026-10-19
Translationsfr