메뉴
HN
Hacker News 23일 전

클라우드플레어의 리눅스 'Copy Fail' 취약점 대응 사례

IMP
7/10
핵심 요약

이 글은 2026년 4월에 공개된 리눅스 커널 권한 상승 취약점(CVE-2026-31431)에 대해 클라우드플레어가 어떻게 신속하게 대응했는지 설명합니다. 사전 구축된 자동화된 커널 패치 파이프라인과 행동 탐지 시스템을 통해 클라우드플레어는 데이터 유출이나 서비스 중단 없이 위협을 완벽히 통제했습니다. 실무자들에게 대규모 인프라 환경에서 선제적인 보안 대응 체계와 커널 업데이트 자동화의 중요성을 보여주는 핵심 사례입니다.

번역된 본문

클라우드플레어는 리눅스 커널 로컬 권한 상승 취약점인 "Copy Fail"(CVE-2026-31431)에 어떻게 대응했는가 2026년 5월 7일 Chris J Arges, Sourov Zaman, Rian Islam (읽는 데 8분 소요)

2026년 4월 29일, "Copy Fail"(CVE-2026-31431)이라는 이름의 리눅스 커널 로컬 권한 상승 취약점이 공개적으로 발표되었습니다. 클라우드플레어의 보안 및 엔지니어링 팀은 취약점이 공개되자마자 즉시 평가를 시작했습니다. 우리는 익스플로잇 기법을 검토하고, 인프라 전반에 대한 노출 정도를 평가했으며, 기존의 행동 탐지 시스템만으로도 이 익스플로잇 패턴을 몇 분 안에 식별할 수 있음을 확인했습니다. 클라우드플레어 환경에는 아무런 영향이 없었으며, 고객 데이터의 위험에 노출되지 않았고 서비스 역시 단 한 차례도 중단되지 않았습니다. 우리의 철저한 사전 대비가 어떻게 빛을 발했는지 계속 읽어보시기 바랍니다.

배경지식: 우리의 리눅스 커널 릴리스 프로세스 클라우드플레어는 전 세계 330개 도시에 데이터센터를 둔 방대한 규모의 글로벌 리눅스 서버 인프라를 운영하고 있습니다. 우리는 이렇게 엄청난 볼륨의 업데이트를 효과적으로 관리하기 위해 커뮤니티의 장기 지원(LTS) 버전을 기반으로 커스텀 리눅스 커널 빌드를 유지하고 있습니다. 우리는 항상 6.12나 6.18처럼 확장된 업데이트 기간의 혜택을 받는 다양한 시리즈의 여러 LTS 버전을 활용할 수 있습니다. 커뮤니티에서 정기적으로 보안 및 안정성 업데이트를 병합하고 릴리스하면, 이로 인해 대략 매주 새로운 내부 커널 빌드를 생성하는 자동화 작업이 트리거됩니다. 이 빌드들은 글로벌 배포 전에 스테이징 데이터센터에서 테스트를 거쳐 안정성을 보장합니다. 성공적인 릴리스 후, ERR(Edge Reboot Release) 파이프라인이 4주 주기의 체계적인 업데이트를 관리하고 엣지 인프라를 재부팅합니다. 컨트롤 플레인 인프라는 일반적으로 최신 커널을 채택하며, 재부팅은 특정 워크로드 요구 사항에 따라 예약됩니다. CVE가 공개 지식이 되는 시점이면, 필수적인 수정 사항은 이미 몇 주 전에 안정적인 리눅스 LTS 릴리스에 통합되어 있는 것이 보통입니다. 우리의 확고한 절차 덕분에 우리는 항상 이러한 패치를 미리 배포할 수 있었습니다. "Copy Fail"이 공개되었을 때, 우리 인프라의 대부분은 6.12 LTS 버전을 실행 중이었으며, 일부 머신은 이미 최신 6.18 LTS 릴리스로 전환을 시작한 상태였습니다.

Copy Fail 취약점에 대하여 대응 과정에 대해 알아보기 전에 이 취약점을 이해하는 것이 도움이 됩니다. 자세한 내용은 Xint Code의 원본 공개 게시물에서 확인할 수 있습니다.

AF_ALG 및 커널 암호화 API 리눅스 커널의 내부 암호화 API는 kTLS 및 IPsec과 같은 기능을 관리합니다. 유저스페이스(User space) 프로그램은 AF_ALG 소켓 패밀리를 통해 이에 접근하며, 이를 통해 권한이 없는 프로세스도 암호화 또는 복호화를 요청할 수 있습니다. algif_aead 모듈은 AEAD(Authenticated Encryption with Associated Data) 암호를 위해 이 과정을 용이하게 합니다. 권한 없는 프로그램은 다음 단계를 따릅니다: AF_ALG 소켓을 열고 AEAD 템플릿에 바인딩합니다. 키를 설정하고 요청 소켓을 수락(accept)합니다. sendmsg() 또는 splice()를 통해 입력을 제출합니다. recvmsg()를 사용하여 작업을 실행합니다. splice() 시스템 콜은 페이지 캐시 참조를 전달하여 데이터를 이동시키므로 이 과정에서 매우 중요한 역할을 합니다.

메모리 메커니즘: 페이지 캐시와 제자리 암호화(In-place crypto) 페이지 캐시는 파일 콘텐츠를 위한 공유 시스템 캐시입니다. setuid 바이너리에 속한 페이지를 수정하는 것은 해당 페이지가 내려갈(evicted) 때까지 모든 사용자에 대해 해당 프로그램을 효과적으로 편집하는 것과 같습니다. 암호화 API는 다양한 메모리 페이지를 연결하는 구조체인 스캐터리스트(scatterlists)를 활용합니다. 2017년에 algif_aead는 제자리 작업(in-place operations)을 위해 최적화되어 대상 페이지와 참조 페이지를 함께 체인으로 연결했습니다. 이 설계에는 알고리즘이 의도된 경계를 넘어 기록하지 못하도록 방지하는 강제성이 결여되어 있었습니다.

취약점: 대상 외 기록(Out-of-bounds write) 사용자가 recvmsg()를 실행할 때, 커널의 authencesn 래퍼는 정상 출력 영역을 넘어 4바이트를 기록합니다: scatterwalk_map_and_copy(tmp + 1, dst, assoclen + cryptlen, 4, 1); 공격자는 splice()를 사용하여 대상 파일의 페이지 캐시 페이지를 스캐터리스트에 연결할 수 있습니다. 그런 다음 이 대상 외 기록(out-of-bounds write)은 캐시된 파일을 오염시키며, 공격자가 어떤 파일이 수정되는지 제어할 수 있게 합니다.

원문 보기
원문 보기 (영어)
How Cloudflare responded to the “Copy Fail” Linux vulnerability 2026-05-07 Chris J Arges Sourov Zaman Rian Islam 8 min read On April 29, 2026, a Linux kernel local privilege escalation vulnerability was publicly disclosed under the name "Copy Fail" ( CVE-2026-31431 ). Cloudflare’s Security and Engineering teams began assessing the vulnerability as soon as it was disclosed. We reviewed the exploit technique, evaluated exposure across our infrastructure, and validated that our existing behavioral detections could identify the exploit pattern within minutes. There was no impact to the Cloudflare environment, no customer data was at risk, and no services were disrupted at any point. Read on to learn how our preparedness paid off. Background Our Linux kernel release process Cloudflare operates a global Linux server infrastructure at an immense scale, with datacenters located across 330 cities . We maintain a custom Linux kernel build based on the community's Long-Term Support (LTS) versions to manage updates effectively at this volume. At any given time, we may utilize multiple LTS versions from various series, such as 6.12 or 6.18, which benefit from extended update periods. The community regularly merges and releases security and stability updates which trigger an automated job to generate a new internal kernel build approximately every week. These builds undergo testing in our staging data centers to ensure stability before a global rollout. Following a successful release, the Edge Reboot Release (ERR) pipeline manages a systematic update and reboot of the edge infrastructure on a four-week cycle. Our control plane infrastructure typically adopts the most recent kernel, with reboots scheduled according to specific workload requirements. By the time a CVE becomes public knowledge, the necessary fix has typically been integrated into stable Linux LTS releases for several weeks. Our established procedures ensure that we have already deployed these patches. At the time of the "Copy Fail" disclosure, the majority of our infrastructure was running the 6.12 LTS version, while a subset of machines had begun transitioning to the newer 6.18 LTS release. About the Copy Fail vulnerability It helps to understand the vulnerability before getting to the response story. A comprehensive write-up can be found in the original Xint Code disclosure post. AF_ALG and the kernel crypto API The Linux kernel's internal crypto API manages functions like kTLS and IPsec. Userspace programs access this via the AF_ALG socket family, allowing unprivileged processes to request encryption or decryption. The algif_aead module facilitates this for Authenticated Encryption with Associated Data (AEAD) ciphers. An unprivileged program follows these steps: Opens an AF_ALG socket and binds to an AEAD template. Sets a key and accepts a request socket. Submits input via sendmsg() or splice() . Executes the operation using recvmsg() . The splice() system call is critical here, as it moves data by passing page cache references. Memory mechanics: page cache and in-place crypto The page cache is a shared system cache for file contents. Modifying a page belonging to a setuid binary effectively edits that program for all users until the page is evicted. The crypto API utilizes scatterlists , which are structures linking various memory pages. In 2017, algif_aead was optimized for in-place operations, chaining destination and reference pages together. This design lacked enforcement to prevent algorithms from writing past intended boundaries. The vulnerability: out-of-bounds write When the user executes recvmsg() , the authencesn wrapper in the kernel performs a 4-byte write past the legitimate output region: scatterwalk_map_and_copy(tmp + 1, dst, assoclen + cryptlen, 4, 1); By using splice() , an attacker can chain a target file's page cache pages to the scatterlist. The out-of-bounds write then taints the cached file, allowing an attacker to control which file is modified, the offset, and the specific 4 bytes written. This means the attacker can manipulate the following with this exploit: File: Any readable file. Offset: Tunable via assoclen and splice parameters. Value: Controlled via AAD bytes 4-7 in sendmsg() The exploit, step by step The default exploit targets /usr/bin/su , a setuid-root binary present on essentially every distribution. Cache Reference: Open /usr/bin/su as O_RDONLY and read() to populate the page cache. Use splice() on the file descriptor to pass these page cache references into the crypto scatterlist. Setup: Create an AF_ALG socket, bind() to authencesn(hmac(sha256),cbc(aes)) , set a key, and accept a request socket without needing privileges. Write Construction: For each 4-byte shellcode chunk: sendmsg() with AAD bytes 4–7 containing the shellcode. splice() the binary into a pipe then the AF_ALG socket so assoclen + cryptlen targets the desired .text offset. Trigger: recvmsg() initiates decryption. authencesn writes its scratch data to the target offset of /usr/bin/su in the page cache. Although the function returns -EBADMSG , the 4-byte write is now in the global page cache. Execution: Running execve("/usr/bin/su") loads the tainted page cache. Since the binary is setuid-root, the injected shellcode executes with root privileges. The upstream fix ( commit a664bf3d603d ) reverts the 2017 in-place optimization, removing the exploit. How we responded When the vulnerability was disclosed, many workstreams started in parallel: Mapping the blast radius: Our security team worked with kernel engineers to determine which kernel versions were vulnerable and assess the potential exposure. Validating coverage: Security reviewed the exploit technique and confirmed that our existing behavioral detections could identify the exploit pattern during authorized internal validation. Proactive threat hunting: Security began searching for signs that the vulnerability had been exploited before it was publicly known, going back 48 hours in our fleet-wide logs. Engineering a mitigation: Kernel engineers began building a runtime mitigation that would protect the fleet without breaking production services. Continuing software updates : Our engineering teams worked on delivering an updated Linux kernel, which required carefully rebooting and rolling it out across our servers. There was no customer impact at any point during this response. Validating detection coverage One of the first things our security team did was confirm that our existing endpoint detection would catch this exploit. Our servers run behavioral detection that continuously monitors process execution patterns. It doesn't rely on knowing about specific vulnerabilities; it watches for anomalous behavior across the fleet. When our engineers validated the vulnerability internally as part of the response, the detection platform flagged it within minutes. The system linked the entire execution chain—starting at the script interpreter, moving through the kernel’s cryptographic subsystem, and ending at the privilege escalation binary—flagging it as malicious based on fleet-wide behavioral patterns. This happened without a signature update, without a rule change, and without human intervention. Our behavioral detection coverage existed before we wrote any custom logic for this particular Copy File exploit. The confirmation was important because it meant we had coverage before writing a vulnerability-specific rule. Hunting for exploitation While our engineering team moved to a more targeted mitigation, our security investigation had been running since disclosure. This is our standard procedure for any critical vulnerability. Our security team operates on a simple principle for critical vulnerabilities: assume compromise until you can prove otherwise. The investigation started from the assumption that exploitation could have occurred before the vulnerability was public, and we worked systematically to either confirm or rule it out. The exploit le