Mass Assignment Updatemodel
TryUpdateModel/UpdateModel binds every posted form field onto the model without an explicit property allow-list, enabling mass assignment / over- posting of sensitive properties (e.g. IsAdmin, roles, prices) (CWE-915).
Standards mapping
- OWASP Top 10
- A08:2021 - Software and Data Integrity Failures
- OWASP ASVS
- V5.1.3 (L1)
Vulnerable vs. safe
TryUpdateModel(user);TryUpdateModel(user, new[] { "Name", "Email" });Why it matters & how to fix it
TryUpdateModel/UpdateModel binds every posted form field onto the model without an explicit property allow-list, enabling mass assignment / over- posting of sensitive properties (e.g. IsAdmin, roles, prices) (CWE-915). Pass an explicit includeProperties list, bind to a purpose-built view model /DTO, or mark protected properties with [BindNever].
References
Rule ID integsec.csharp.misc.mass-assignment-updatemodel - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Other Security ChecksChild Process Shell True
- JavaScript / TypeScript - Other Security ChecksOpen Redirect Tainted Input
- Python - Other Security ChecksDjango Mark Safe
- Python - Other Security ChecksFlask Debug Enabled
- Python - Other Security ChecksFlask Render Template String
- Python - Other Security ChecksInsecure Tempfile Mktemp