flawopen.com/보안 사고/Baron Samedit

Baron Samedit: 단 하나의 역슬래시 뒤에 10년 동안 숨겨져 있던 Root 권한

High — Local privilege escalation CWE-787: Out-of-bounds Write Disclosed 26 January 2021
쉬운 설명 (ELI5)

문서를 처리하는 직원은 '역슬래시가 나오면 바로 다음 글자를 있는 그대로 베껴 적는다'는 규칙을 따릅니다. 누군가 맨 끝이 역슬래시로 끝나는 문서를 제출했습니다. 직원은 다음 글자가 종이 끝을 넘어 존재하지 않음에도 필기를 멈추지 않고 책상 아래 놓인 관리자 승인 문서에 권한을 덮어써 버렸습니다.

That second point is the durable engineering lesson. The unescaping function was correct given its assumed precondition. The vulnerability lived in the gap between a documented assumption and an unusual call path that violated it. Preconditions enforced by convention rather than by code fail silently, and they fail years later, when whoever knew the convention has moved on.

Why a local bug matters as much as a remote one

Privilege escalation flaws are sometimes discounted because they require existing access. That reasoning misreads how intrusions work. Attackers routinely obtain low-privilege access first — a compromised web application process, a stolen SSH key for an unprivileged account, a container breakout, a malicious dependency running in CI. A reliable local root exploit converts that foothold into total control of the host.

In shared environments the effect compounds: on a multi-user build server or a shell host, this bug meant every user was effectively root.

The lessons that actually transfer

FAQ

Did I need to be in the sudoers file?

No. That is what made this unusually severe — the overflow occurred during argument processing, before any authorisation decision. Users with no sudo rights whatsoever could exploit it.

Would a memory-safe language have prevented it?

This specific failure mode, yes — a bounds-checked language would panic or throw rather than write out of bounds, turning a root exploit into a crash. The logic error of mishandling a trailing escape could still exist; its consequences would be far less severe.

Related reading

출처 및 공식 보안 권고