CWE-607 公开静态最终域索引互斥的对象

admin 2021年12月16日16:17:42评论74 views字数 807阅读2分41秒阅读模式

CWE-607 公开静态最终域索引互斥的对象

Public Static Final Field References Mutable Object

结构: Simple

Abstraction: Variant

状态: Draft

被利用可能性: unkown

基本描述

A public or protected static final field references a mutable object, which allows the object to be changed by malicious code, or accidentally from another package.

相关缺陷

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

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

适用平台

Language: {'cwe_Name': 'Java', 'cwe_Prevalence': 'Undetermined'}

常见的影响

范围 影响 注释
Integrity Modify Application Data

可能的缓解方案

Implementation

策略:

Protect mutable objects by making them private. Restrict access to the getter and setter as well.

示例代码

Here, an array (which is inherently mutable) is labeled public static final.

bad Java

public static final String[] USER_ROLES;

分类映射

映射的分类名 ImNode ID Fit Mapped Node Name
Software Fault Patterns SFP23 Exposed Data

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

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年12月16日16:17:42
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CWE-607 公开静态最终域索引互斥的对象https://cn-sec.com/archives/613083.html

发表评论

匿名网友 填写信息