Vulnerability in EPiServer.Forms

Try our conversational search powered by Generative AI!

Rendering of partial view clears ModelState errors

Found in

EPiServer.CMS.Core 12.17.1

Fixed in

EPiServer.CMS.Core 12.18.0


Sep 07, 2023


Sep 18, 2023


CMS Core


Closed, Fixed and tested


Fixed an issue that cleared errors on ViewContext.ModelState when you rendered a partial content (such as  through a content area). For example:

  1. Add following line to DefaultPageController.Index method.
    ModelState.AddModelError("AnError", "some error");
  2. Put breakpoints in a view that renders a contentarea before and after the contentarea (such as StandardPage/index.cshmtl)
  3. Access a page that contained an area item that is rendered with a view such as  https://localhost:5000/en/about-us/
  4. In the breakpoint before the rendering of the contentarea, look at ViewContext.ModelState. The error was present in the breakpoint before rendering the content area but Errors was cleared after the rendering of the contentarea.