CWE-370 在初始检查后缺失对证书撤销的验证

admin 2021年12月16日16:01:11评论72 views字数 2271阅读7分34秒阅读模式

CWE-370 在初始检查后缺失对证书撤销的验证

Missing Check for Certificate Revocation after Initial Check

结构: Simple

Abstraction: Variant

状态: Draft

被利用可能性: Medium

基本描述

The software does not check the revocation status of a certificate after its initial revocation check, which can cause the software to perform privileged actions even after the certificate is revoked at a later time.

扩展描述

If the revocation status of a certificate is not checked before each action that requires privileges, the system may be subject to a race condition. If a certificate is revoked after the initial check, all subsequent actions taken with the owner of the revoked certificate will lose all benefits guaranteed by the certificate. In fact, it is almost certain that the use of a revoked certificate indicates malicious activity.

相关缺陷

  • cwe_Nature: ChildOf cwe_CWE_ID: 299 cwe_View_ID: 1000 cwe_Ordinal: Primary

  • cwe_Nature: ChildOf cwe_CWE_ID: 299 cwe_View_ID: 699 cwe_Ordinal: Primary

  • cwe_Nature: PeerOf cwe_CWE_ID: 296 cwe_View_ID: 1000

  • cwe_Nature: PeerOf cwe_CWE_ID: 297 cwe_View_ID: 1000

  • cwe_Nature: PeerOf cwe_CWE_ID: 298 cwe_View_ID: 1000

适用平台

Language: {'cwe_Class': 'Language-Independent', 'cwe_Prevalence': 'Undetermined'}

常见的影响

范围 影响 注释
Access Control Gain Privileges or Assume Identity Trust may be assigned to an entity who is not who it claims to be.
Integrity Modify Application Data Data from an untrusted (and possibly malicious) source may be integrated.
Confidentiality Read Application Data Data may be disclosed to an entity impersonating a trusted entity, resulting in information disclosure.

可能的缓解方案

Architecture and Design

策略:

Ensure that certificates are checked for revoked status before each use of a protected resource. If the certificate is checked before each access of a protected resource, the delay subject to a possible race condition becomes almost negligible and significantly reduces the risk associated with this issue.

示例代码

The following code checks a certificate before performing an action.

bad C

if (cert = SSL_get_peer_certificate(ssl)) {

foo=SSL_get_verify_result(ssl);
if (X509_V_OK==foo)


//do stuff

foo=SSL_get_verify_result(ssl);
//do more stuff without the check.

While the code performs the certificate verification before each action, it does not check the result of the verification after the initial attempt. The certificate may have been revoked in the time between the privileged actions.

分类映射

映射的分类名 ImNode ID Fit Mapped Node Name
CLASP Race condition in checking for certificate revocation
Software Fault Patterns SFP20 Race Condition Window

相关攻击模式

  • CAPEC-26
  • CAPEC-29

引用

文章来源于互联网:scap中文网

免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年12月16日16:01:11
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CWE-370 在初始检查后缺失对证书撤销的验证https://cn-sec.com/archives/613159.html
                  免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

发表评论

匿名网友 填写信息