Microarchitectural Defense and Recovery Against Buffer Overflow Attacks

버퍼 오버플로우 공격에 대한 마이크로구조적 방어 및 복구 기법

  • 최린 (고려대학교 전자컴퓨터공학과) ;
  • 신용 (고려대학교 전자컴퓨터공학과) ;
  • 이상훈 (고려대학교 전자컴퓨터공학과)
  • Published : 2006.04.01

Abstract

The buffer overflow attack is the single most dominant and lethal form of security exploits as evidenced by recent worm outbreaks such as Code Red and SQL Stammer. In this paper, we propose microarchitectural techniques that can detect and recover from such malicious code attacks. The idea is that the buffer overflow attacks usually exhibit abnormal behaviors in the system. This kind of unusual signs can be easily detected by checking the safety of memory references at runtime, avoiding the potential data or control corruptions made by such attacks. Both the hardware cost and the performance penalty of enforcing the safety guards are negligible. In addition, we propose a more aggressive technique called corruption recovery buffer (CRB), which can further increase the level of security. Combined with the safety guards, the CRB can be used to save suspicious writes made by an attack and can restore the original architecture state before the attack. By performing detailed execution-driven simulations on the programs selected from SPEC CPU2000 benchmark, we evaluate the effectiveness of the proposed microarchitectural techniques. Experimental data shows that enforcing a single safety guard can reduce the number of system failures substantially by protecting the stack against return address corruptions made by the attacks. Furthermore, a small 1KB CRB can nullify additional data corruptions made by stack smashing attacks with only less than 2% performance penalty.

버퍼 오버플로우 공격은 Code Red나 SQL Stammer와 같은 최근의 웜의 발발에서 알 수 있는 것과 같이 가장 강력하고 치명적인 형태의 악성 코드 공격이다. 버퍼 오버플로우 공격은 일반적으로 시스템에 비정상적인 증상들을 유발한다. 버퍼 오버플로우 공격에 대한 기존의 대처방안들은 심각한 성능 저하를 초래하거나, 다양한 형태의 버퍼 오버플로우 공격을 모두 방지하지 못했으며, 특히 일반적으로 사용되는 소프트웨어 패치를 사용하는 방법은 버퍼 오버플로우 입의 확산을 효과적으로 차단하지 못한다. 이러한 문제를 해결하고자 본 논문에서는 적은 하드웨어 비용과 성능 저하만으로 거의 모든 악성 코드 공격을 탐지하고 피해를 복구할 수 있도록 하는 복귀 주소 포인터 스택 (Return Address Pointer Stack: RAPS) 과 변조 복구 버퍼 (Corruption Recovery Buffer: CRB)라는 마이크로 구조 기술들을 제안한다. 버퍼 오버플로우 공격으로 인한 비정상적인 증상들은 RAPS를 통해 프로세스 실행 중 메모리 참조의 안전성을 점검함으로써 쉽게 탐지될 수 있으며, 이는 그러한 공격들에 의한 잠재적인 데이타 흑은 제어 변조를 피하는 것을 가능하게 한다. 안전 점검 장치의 사용으로 인한 하드웨어 비용과 성능 손실은 거의 발생하지 않는다. 또한, RAPS에 비해 더욱 강도 높은 방법인 CRB를 이용하여 보안 수준을 더욱 향상시킬 수 있다. 변조 복구 버퍼는 안전 점검 장치와 결합되어 버퍼 오버플로우 공격에 의해 발생했을 가능성이 있는 의심스러운 쓰기들을 저장함으로써 공격이 탐지되는 경우 메모리의 상태를 공격 이전의 상태로 복구시킬 수 있다. SPEC CPU2000 벤치마크 중에서 선정한 프로그램들에 대해 상세한 시뮬레이션을 수행함으로써, 제안된 마이크로구조 기술들의 효율성을 평가할 수 있다. 실험 결과는 안전 점검 장치를 사용하여 공격으로 인한 복귀 주소 변조로부터 스택 영역을 방어하는 것이 시스템의 이상 증상들을 상당 부분 감소시킬 수 있다는 것을 보여준다. 또한, 1KB 크기의 작은 변조 복구 버퍼를 안전 점검 장치와 함께 사용할 경우 스택 스매싱 공격으로 인해 발생하는 추가적인 데이타 변조들까지 막아낼 수가 있는데, 이로 인한 성능 저하는 2% 미만에 불과하다.

Keywords

References

  1. CERT/CC Statistics 1988-2003, http://www.cert.org/stats/cert_stats.html
  2. Cooperative Association for Internet Data Analysis(CAIDA), Analysis of the Sapphire Worm, http://www.caida.org/analysis/ security/sapphier/, Jan. 2003
  3. Common Vulnerabilities and Exposures(CVE), [TECH] Vulnerability Types Seen in CVE, http://cve.mitre.org/board/archives/2002-10/msg00005.html
  4. SANS Institute and FBI, The Twenty Most Critical Internet Security Vulnerabilities-The Expert's Consensus, http://www.sans.org/top20, 2003
  5. Snow, B., Future of Security, Panel Presentation at IEEE Security and Privacy, May 1999
  6. Openwall Project, Linux kernel patch from the open wall project, http://openwall.com/linux
  7. Chiueh T.-c. and Hsu F.-H., RAD: A CompileTime Solution to Buffer Overflow Attacks, In Proceedings of the 21st International Conference on Distributed Computing Systems, 2001 https://doi.org/10.1109/ICDSC.2001.918971
  8. Cowan, C., Beattie, S., Day R. F., Pu, C., Wagle, P., and Walthinsen, E., Protecting Systems from Stack Smashing Attacks with StackGuard, In the Linux Expo, 1999
  9. Lee, G. and Tyagi, A., Encoded Program Counter: Self-Protection from Buffer Overflow Attack, In Proceedings of the International Conference on Internet Computing, June 2000
  10. Pyo C. and Lee, G., Encoding Function Pointers and Memory Arrangement Checking against Buffer Overflow Attack, In Proceedings of the Fifth International Conference on Information and Communications Security, October 2003
  11. Jones R. and Kelly, P., Bounds Checking for C, http://www-ala.doc.ic.ac.uk/-phjk/BoundsChecking.html, July 1995.
  12. Baratloo, A., Singh, N., and Tsai, T., Transparent Run-Time Defense Against Stack Smashing Attacks, In Proceedings of the USENIX Annual Technical Conference, June 2000
  13. Richard W M Jones and Paul H J Kelly, Backwards-Compatible Bounds Checking for Arrays and Pointers in C Programs, May 1997
  14. Cowan, C., Wagle, P., Pu, C, Beattie S. and Walpole, L, Buffer Overflows: Attacks and Defenses for the Vulnerability of the Decade, In Proceedings of the DARPA Information Survivability Conference and Exposition. January 2000 https://doi.org/10.1109/DISCEX.2000.821514
  15. Peter Silberman and Richard Johnson, A Comparison of Buffer Overflow Prevention Implementations and Weaknesses
  16. Bulba and Ki13r, Bypassing Stackguard and Stackshield, Phrack, 10(56), May 2000
  17. Jun Xu, Zbigniew Kalbarczyk, Sanjay Patel and Ravishankar K. Iyer, Architecture Support for Defending Against Buffer Overflow Attacks
  18. John P. McGregor, David K. Karig, Zhijie Shi, and Ruby B. Lee, A Processor Architecture Defense against Buffer Overflow https://doi.org/10.1109/ITRE.2003.1270612