CVE-2017-20229
MAWK · MAWK (AWK Interpreter)
MAWK 1.3.3-17 and prior contains a stack-based buffer overflow vulnerability that allows arbitrary code execution via crafted, malicious input.
Executive summary
A critical stack-based buffer overflow in the MAWK interpreter allows attackers to achieve arbitrary code execution by exploiting inadequate boundary checks on user-supplied input.
Vulnerability
The MAWK utility fails to validate the length of input data, leading to a stack buffer overflow. An attacker can provide unauthenticated malicious input that overflows the buffer, allowing for the execution of a ROP chain to spawn a shell with the application's privileges.
Business impact
Since AWK interpreters are frequently used in automated scripts and system processing, an exploit could allow an attacker to gain control over critical system tasks. The CVSS score of 9.8 indicates a critical risk to system integrity and the potential for full administrative compromise.
Remediation
Immediate Action: Update MAWK to the latest version provided by your operating system's package manager (e.g., apt-get install mawk).
Proactive Monitoring: Audit shell scripts that utilize MAWK to ensure they are not processing untrusted, unsanitized data from external sources.
Compensating Controls: Implement restrictive SELinux or AppArmor profiles for the MAWK binary to limit the actions it can perform on the system.
Exploitation status
Public Exploit Available: false
Analyst recommendation
The MAWK interpreter is a core utility in many Linux distributions. Administrators must ensure that all systems are updated to a version that includes boundary check fixes to prevent attackers from leveraging scripts as an execution vector.