Skip to content

Instantly share code, notes, and snippets.

@davidACash
Created January 23, 2019 17:15
Show Gist options
  • Save davidACash/0de9dbc58a5d219c20b1c98fc7c2d6c0 to your computer and use it in GitHub Desktop.
Save davidACash/0de9dbc58a5d219c20b1c98fc7c2d6c0 to your computer and use it in GitHub Desktop.
CWE-915 Solution C#
public class TestController : Controller
{
[HttpPost]
public ActionResult TestMethod([Bind(Include = TestModel.BindProperties)] TestModel testModel)
{
// ...
}
}
public class TestModel
{
public const string BindProperty = “Name, Description, Amount”;
public Guid Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public int Amount { get; set; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment