4

使用过时方法缺陷漏洞

 2 years ago
source link: https://www.secpulse.com/archives/172921.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

使用过时方法缺陷漏洞

一、什么是使用过时方法缺陷?

代码使用了不推荐使用的或已经过时的方法,这表明该代码没有得到积极地审查或维护。

随着编程语言的发展,由于以下原因,方法有时会过时:

1、语言进步

2、更深入理解如何安全有效地执行操作

3、改变了某些特定操作的规范/惯例

通常,被删除的方法会被更新的对等方法所取代,后者以某种不同的方式执行同一任务。

二、使用过时方法缺陷的构成条件有哪些?

代码使用了不推荐使用的或已经过时的方法。

三、使用过时方法缺陷会造成哪些后果?

使用过时方法可能导致程序质量下降。

四、使用过时方法缺陷的防范和修补方法有哪些?

请参阅过时方法的文档,以确定为什么不推荐使用该过时的方法,并了解实现相同功能的替代方法。

五、使用过时方法缺陷样例(Date类中的大部分方法都已经被Calendar类中的方法所取代):

1.png

用 Wukong软件检测上述程序代码,则可以发现代码中存在着“使用过时方法” 导致的代码缺陷,如下图(Date类中的大部分方法都已经被Calendar类中的方法所取代)

2.png

使用过时方法缺陷在CWE中被编号为CWE-477:Useof Obsolete Function

本文作者:中科天齐软件安全

本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/172921.html


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK