// POST: Movies/Create// 为了防止“过多发布”攻击,请启用要绑定到的特定属性,有关 // 详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkId=317598。[HttpPost][ValidateAntiForgeryToken]publicActionResultCreate([Bind(Include="ID,Title,ReleaseDate,Genre,Price")]Movie movie){if(ModelState.IsValid){ db.Movies.Add(movie); db.SaveChanges();returnRedirectToAction("Index");}returnView(movie);}其中[Bind(Include="ID,Title,ReleaseDate,Genre,Price")]The Bind attribute is another important security mechanism that keeps hackers from over-posting data to your model.
大意是:BindAttribute 是一个防止黑客“OverPost”攻击的重要安全机制。
"OverPost":
其实就是使用表单提交工具模拟提交时,手动加一些奇怪的东西。Form
Post时,RequestBody是ID=1&Title=123&ReleaseDate=20150502&Genre=Science&Price=10&HHH=test。“HHH=test”就是“over-posting”了。详细可查看: Over Posting Note
原文:https://www.cnblogs.com/yunspider/p/9123707.html