Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Session Veracode CWE ID 259_Session_Credentials_Veracode - Fatal编程技术网

Session Veracode CWE ID 259

Session Veracode CWE ID 259,session,credentials,veracode,Session,Credentials,Veracode,session.setAttribute行中的以下代码中存在CWE ID 259缺陷 public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { HttpSession session = req.getSession(); session.setAttribute("resetPassword", "Gets are

session.setAttribute行中的以下代码中存在CWE ID 259缺陷

public void doGet(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {

    HttpSession session = req.getSession();
    session.setAttribute("resetPassword", "Gets are not accepted.");
    this.getServletContext().getRequestDispatcher("pwReset.jsp").forward(req, resp);    
}

需要有关修复此问题的帮助。

首先,您必须了解像VeraCode这样的代码分析工具可能会给出误报&您可能需要从安全团队获取一些标志的例外(并且可能不一定有代码修复)

CWEID259是关于原始凭证信息的硬编码,比如代码中的密码&这是一种非常糟糕的编码实践

对于您的情况,
session.setAttribute(“resetPassword”,“get不被接受”)
,VeraCode如何知道您正在硬编码原始密码

很可能是因为您将属性命名为
resetPassword

因此,黑客修复方法是将此属性名称更改为与wordpassword不相似,但即使在此修复之后,出于所有实际目的,漏洞仍然存在

永久的解决办法是在代码中硬编码/加密密码,或者从代码中移动硬编码密码&利用其他安全机制获取重置密码信息

请阅读潜在缓解措施部分,网址为-