Back to skill

Security audit

swap

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward Linux swap-configuration guide, but its root-level commands should be used carefully because they change system memory and boot settings.

Install only if you want guidance for Linux swap administration. Before running the commands, review current swap and configuration state, back up /etc/fstab and /etc/sysctl.conf, avoid duplicate entries, confirm disk space and memory headroom, and be especially careful using swapoff on production or low-memory systems.

Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill instructs users to modify active swap state and append directly to critical configuration files like /etc/fstab and /etc/sysctl.conf without explicit warnings, validation, backup steps, or rollback guidance. Mistakes here can cause boot issues, duplicate entries, degraded performance, or temporary memory pressure during swapoff, especially on production systems.

Chaining Abuse

High
Category
Tool Misuse
Content
```bash
# Add to /etc/fstab
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
```

Verify the entry:
Confidence
94% confidence
Finding
Appending directly to /etc/fstab via a shell pipeline is risky because it performs a non-idempotent privileged write with no validation of existing entries, filesystem support, or syntax correctness. A malformed or duplicate fstab entry can prevent clean boot behavior or leave the system in an inconsistent state after reboot.

Chaining Abuse

High
Category
Tool Misuse
Content
sudo sysctl -w vm.swappiness=20

# Persist across reboots
echo 'vm.swappiness=20' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
```
Confidence
92% confidence
Finding
Appending vm.swappiness to /etc/sysctl.conf through a pipeline is non-idempotent and can create duplicate or conflicting settings that make system behavior unpredictable. Using sudo tee -a without checking existing configuration also encourages unsafe direct edits to a critical system-wide config file.

Static analysis

No suspicious patterns detected.