1

我使用 Fortify SCA 扫描了我的源代码

我在检查 Fortify 报告时遇到了ASP.NET MVC Bad Practices: Controller Action Not Restricted to POST (API Abuse, Structural)错误

Fortify 发现高级错误说

Recommendations:

The following controller action accepts only the POST verb because it has the
[HttpPost]     attribute:


[HttpPost]
public ActionResult UpdateWidget(Model model) 
{
// ... controller logic
}

但我看了那行代码。它包含

[HtttpPost]

属性。

是假阳性还是假阳性?

4

1 回答 1

1

Fortify SCA 本身给出了两个对比声明。

ASP.NET MVC 不良做法:控制器操作不限于 POST(API 滥用、结构性)

建议:

The following controller action accepts only the POST verb because it has the
[HttpPost]     attribute:

如果您在 UpdateWidget 方法中使用 Model 更新模型或 DB,请添加更安全的 HttpPost 操作属性。如果您确定已添加 HttpPost 操作属性,请忽略 Fortify 错误

于 2014-05-08T11:00:14.217 回答