CVE-2002-0542

OpenBSD <3.1 - Privilege Escalation

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 1 public exploit for CVE-2002-0542. PoCs published by Przemyslaw Frasunek.

AI-analyzed exploit summary This exploit leverages a vulnerability in OpenBSD's default cron jobs where the mail(1) utility processes escaped characters in message text as commands. The PoC creates a file with a malicious escape sequence that, when processed by mail(1), executes a command to set /bin/sh as suid root.

Description

mail in OpenBSD 2.9 and 3.0 processes a tilde (~) escape character in a message even when it is not in interactive mode, which could allow local users to gain root privileges via calls to mail in cron.

Exploits (1)

exploitdb WORKING POC VERIFIED
by Przemyslaw Frasunek · clocalopenbsd
https://www.exploit-db.com/exploits/21373

This exploit leverages a vulnerability in OpenBSD's default cron jobs where the mail(1) utility processes escaped characters in message text as commands. The PoC creates a file with a malicious escape sequence that, when processed by mail(1), executes a command to set /bin/sh as suid root.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Trivial
Reliability
Reliable
Target: OpenBSD 3.0 (before 08 Apr 2002)
No auth needed
Prerequisites: Access to create files in /tmp · Wait for /etc/daily cron job to execute
devstral-2 · analyzed Feb 16, 2026 Full analysis →

References (6)

Core 6
Core References
Various Sources x_refsource_confirm
http://www.openbsd.org/errata30.html#mail
Mailing List mailing-list x_refsource_bugtraq
http://marc.info/?l=bugtraq&m=101855467811695&w=2
Exploit, Patch, Vendor Advisory vdb-entry x_refsource_bid
http://www.securityfocus.com/bid/4495
Patch, Vendor Advisory vdb-entry x_refsource_xf
http://www.iss.net/security_center/static/8818.php
Exploit, Vendor Advisory mailing-list x_refsource_bugtraq
http://online.securityfocus.com/archive/1/267089
Third Party Advisory, VDB Entry vdb-entry x_refsource_osvdb
http://www.osvdb.org/5269

Scores

EPSS 0.0153
EPSS Percentile 71.5%

Details

Status published
Products (2)
openbsd/openbsd 2.9
openbsd/openbsd 3.0
Published Jul 03, 2002
Tracked Since Feb 18, 2026