什么是Null pointer dereference?

问题来源

搜索exploit的时候经常看到。

简述

CWE-476: NULL Pointer Dereference :
A NULL pointer dereference occurs when the application dereferences a pointer that it expects to be valid, but is NULL, typically causing a crash or exit.

Null pointer - Wikipedia :
Because a null pointer does not point to a meaningful object, an attempt to dereference (ie. access the data stored at that memory location) a null pointer usually (but not always) causes a run-time error or immediate program crash.

被CWE(Common Weakness Enumeration)收录的一种程序缺陷类型。
缺陷来自于程序解引用(例如访问指针指向的内存数据)了一个空指针(本应为一个有效的指针)

1200 - Weaknesses in the 2019 CWE Top 25 Most Dangerous Software Errors

1. Improper Restriction of Operations within the Bounds of a Memory Buffer - (119)
2. Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') - (79)
3. Improper Input Validation - (20)
4. Information Exposure - (200)
5. Out-of-bounds Read - (125)
6. Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') - (89)
7. Use After Free - (416)
8. Integer Overflow or Wraparound - (190)
9. Cross-Site Request Forgery (CSRF) - (352)
10. Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') - (22)
11. Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') - (78)
12. Out-of-bounds Write - (787)
13. Improper Authentication - (287)
14. NULL Pointer Dereference - (476)
15. Incorrect Permission Assignment for Critical Resource - (732)
16. Unrestricted Upload of File with Dangerous Type - (434)
17. Improper Restriction of XML External Entity Reference - (611)
18. Improper Control of Generation of Code ('Code Injection') - (94)
19. Use of Hard-coded Credentials - (798)
20. Uncontrolled Resource Consumption - (400)
21. Missing Release of Resource after Effective Lifetime - (772)
22. Untrusted Search Path - (426)
23. Deserialization of Untrusted Data - (502)
24. Improper Privilege Management - (269)
25. Improper Certificate Validation - (295)

在2019年CWE Top 25 Most Dangerous Software Errors排在14位。其中我比较熟悉的Use After Free排在第七位。

案例

CVE-2018-5333

研究完了再来更新...

参考资料

CWE-476: NULL Pointer Dereference
CWE VIEW: Weaknesses in the 2019 CWE Top 25 Most Dangerous Software Errors
Null pointer - Wikipedia

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Introductions to pointers A pointer is a variable that ho...
    linceln阅读 2,833评论 0 0
  • 目前已转至个人博客,本系列地址:Lam's Blog - Knowledge as Action UWF_NULL...
    格子林ll阅读 30,867评论 0 2
  • 原文:https://developer.android.com/reference/android/media/...
    thebestofrocky阅读 11,304评论 0 6
  • 因為小猴子工作性質的關係,我嘗試找遍基督城所有10點後仍在營業的餐廳,大多都是中餐館。 想吃印度餐想吃kiwi洋菜...
    MIRROR1027阅读 1,326评论 0 0
  • 获得他人认同的规则 规则一、唯一能从辩论中获利的方法,就是杜绝辩论 规则二:尊重他人的简介,任何时候都不要指责对方...
    zjejlzc阅读 1,729评论 0 0