Skip to content

[BUG] CSRF vulnerability in GodObjectProfile — GET requests mutate state #89

@rbmathis

Description

@rbmathis

Summary

The GodObjectProfile action mutates state via GET query parameters, enabling CSRF attacks.

Steps to reproduce

  1. Navigate to /Home/GodObjectProfile
  2. Observe anchor links like <a href="?action=update&field=Name&value=UpdatedName">\
  3. Embed that URL on an external page
  4. When a logged-in user visits the external page, their profile data is mutated without consent

Expected behavior

State-changing operations should only be possible via POST requests with anti-forgery tokens. GET requests should be read-only.

Actual behavior

GET requests with query parameters (?action=update&field=Name&value=...) mutate application state. Any external site can trigger these mutations by embedding the URL.

Relevant logs/stack traces

N/A — no error produced; the vulnerability is silent.

Environment

.NET 9, all browsers, all OS

Impact

  • Blocking

Additional context

Files affected: \Controllers/HomeController.cs, \Views/Home/GodObjectProfile.cshtml\

Fix required:

  • Convert state-changing operations to POST requests
  • Add [HttpPost]\ and [ValidateAntiForgeryToken]\ attributes
  • Use form submissions instead of anchor links for mutations
  • Ensure GET requests are read-only

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcriticaldifficultHigh complexity or multi-steppipeline:planningSDLC Pipeline — Planning stagesecuritySecurity related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions