【问题标题】:"Client Side Only Validation" in Partial Class-Checkmarx Vulnerability - RemediationPartial Class-Checkmarx 漏洞中的“仅客户端验证” - 修复
【发布时间】:2021-01-05 05:08:58
【问题描述】:

通过 Checkmarx 工具扫描代码库,我得到“仅客户端验证”漏洞,在使用部分类的地方都会提出这一点。

第 1 点:

Imports System.Data
Imports System.Data.SqlClient
Imports System.Security.Cryptography
Partial Class Frm_ChangePwd               //Checkmarx points to this line as vulnerability
    Inherits System.Web.UI.Page

第 2 点:

Imports System.Data
Imports System.Data.SqlClient
Imports System.Security.Cryptography
Partial Class Frm_changepassword        //Checkmarx points to this line as vulnerability
    Inherits System.Web.UI.Page

Checkmarx 还给出了这个细节“没有找到服务器端验证[代码文件路径]\Frm_changepassword.aspx.vb 文件,仅使用客户端验证是不够的,因为它很容易绕过”

每当使用部分类时,Checkmarx 都会引发此问题,但我无法理解我究竟应该做什么来补救这一点。

【问题讨论】:

    标签: validation client checkmarx secure-coding


    【解决方案1】:

    之所以出现这一发现,是因为 Checkmarx 没有在您的代码中看到任何服务器端验证器。具体来说,它会查找 Page.IsValid 属性。我建议使用此属性添加验证检查:

    Page.Validate()
    
    If Page.IsValid = True Then
    ....
    
    Else
    ....
    End If
    

    【讨论】:

    • 谢谢。那行得通。开发者只检查了“Page.IsValid”,Checkmarx 关闭了漏洞。
    猜你喜欢
    • 2019-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-12
    • 2020-07-21
    • 1970-01-01
    • 2018-01-01
    • 1970-01-01
    相关资源
    最近更新 更多