[사이트 소개] 보다 나은 개발자가 되려는 사람과 및 보안 전문가를 위한 ...

mach의 이미지

CWE를 이미 접하고 계신분들이 있겠지만, 검색해보니 내용이 없는 듯 하여, 소개합니다.

MiTRE는 보안전문가들 사이에 유명한 CVE에 이어서, CWE(Common Weakness Enumeration; http://cwe.mitre.org/ )사이트를 운영하고 있습니다.

현재 700여개가 넘는 소프트웨어 취약성 데이터베이스를 가지고 있습니다.
그 중 유명한 SANS(http://www.sans.org/)와 같이 발표하는, Top 25 소프트웨어 에러(http://cwe.mitre.org/top25/index.html)중 일부를 발췌해 보았습니다.

    * CWE-20: Improper Input Validation
    * CWE-116: Improper Encoding or Escaping of Output
    * CWE-89: Failure to Preserve SQL Query Structure ('SQL Injection')
    * CWE-79: Failure to Preserve Web Page Structure ('Cross-site Scripting')
    * CWE-78: Failure to Preserve OS Command Structure ('OS Command Injection')
    * CWE-319: Cleartext Transmission of Sensitive Information
    * CWE-352: Cross-Site Request Forgery (CSRF)
    * CWE-362: Race Condition
    * CWE-209: Error Message Information Leak

각각의 내용 구성은 취약성에 대한 정의/설명과, 해당 취약성의 플랫폼(언어등), 반향, 빈도 및 예제코드(해당언어별), 및 이를 완화시키기 위한 방법론을 기술하고 있습니다. 하나 하나 읽어가다 보면, 이미 알고 있던 지식도 있으나, 그 동안 고려 못했던 점도 발견할 수 있을 것입니다. 무엇보다 잘 정리된 문서형식을 보면, 저 개인에게는 묘한 부러움(?)을 가지게 합니다.

거두 절미하고, 예를 들어, 첫번째, CWE-20인 입력값 검사를 제대로 처리하지 않을 경우, 벌어질 수 있는 취약성을 논의하고 있습니다. 자세한 것은 사이트 ( http://cwe.mitre.org/data/definitions/20.html )를 방문해 보면 되겠습니다.라고 하면 너무 불친절한 것 같아서, 내용의 극히, 일부를 의역해 드립니다.

CWE-20하나에도, 몇몇개의 언어 예제가 나오는데, 그 중 C Example을 예시하자면,

void parse_data(char *untrusted_input){
    int m, n, error;
 
    error = sscanf(untrusted_input, "%d:%d", &m, &n);
    if ( EOF == error ){
         die("Did not specify integer value. Die evil hacker!\n");
    }
    /* proceed assuming n and m are initialized correctly */
    .....
 
}

위 프로그램에서는 sscanf()를 이용하여 2개의 정수 값을 입력 받는 코드를 선보이고 있습니다.
그런데, 해커가 의도적으로 또는 사용자가 실수로 다음과 같은 입력을 수행한 경우,
123:
위 프로그램에서 변수 m 값은 초기화가 될 것이지만, 변수 n 값은 초기화가 되지 않을 것입니다.

이는 초기화 되지 않은 변수를 사용하는 경우의 문제(CWE-457, 즉, 'Use of Uninitialized Variable')을 야기할 것입니다.
....주) 당연히, CWE-457을 읽어 보고 싶어지지 않습니까?

아래 간단히 사이트 소개를 발췌하였습니다.

What Is CWE?
Targeted to developers and security practitioners, the Common Weakness Enumeration (CWE) is a formal list of software weakness types created to:
 
Serve as a common language for describing software security weaknesses in architecture, design, or code. 
Serve as a standard measuring stick for software security tools targeting these weaknesses. 
Provide a common baseline standard for weakness identification, mitigation, and prevention efforts. 

----------------------
* 참고
- CVE(Common Vulnerabilities and Exposures - The Standard for Information Security Vulnerability Names; http://cve.mitre.org/ )

* 700여개를 다 읽고, 이를 자신이 개발하는 프로그램이나, 관리하는 프로그램 등에 반영한다면, 많은 소프트웨어들이 보다 정교해질 듯 합니다. 그런 분들이 보다 많아 지기를 기대해 봅니다.

댓글

GunSmoke의 이미지

scanf() 함수군의 보안 취약점 관련 얘기는 이미 유명하죠.

좋은 자료 소개해주셔서 감사합니다.

大逆戰

大逆戰

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.