Skip to content
MediumOS hardeningBLWK-KERNEL-010

Hardlink creation protection is disabled ​

What this means ​

fs.protected_hardlinks is 0 — any user can create a hardlink to a file they don't own (e.g. a setuid binary or a file another process will later run as root), a classic TOCTOU/race primitive for local privilege escalation.

How to fix it ​

Set fs.protected_hardlinks=1 via /etc/sysctl.d/ and run sysctl --system.

Check it yourself ​

Run a scan and look for BLWK-KERNEL-010 in the results:

sh
bulwark scan

Installed the standalone CLI package instead of the app? The command is bulwarkctl.

How Bulwark decides

Bulwark reads sysctl_kernel and reports this check when:

text
protected_hardlinks == 0

If a value can't be read, Bulwark reports the check as undetermined rather than passing it. View the rule source.

References ​

Released under the Apache License 2.0.