Security improvements
Use your agent to review a deliberately vulnerable API, prioritize findings, and fix a few with verification.
Goal
Use the agent to find credible security issues (injection, broken access control, secret handling, open redirects, verbose errors) and fix a subset with care. The exercise pairs well with a secure-by-default mindset: minimize trust of model output, validate, and re-read every diff for dangerous "fixes".
Getting started
The repository ships an intentionally vulnerable .NET API. Run it locally only.
dotnet runThe app starts on http://localhost:5137 with the default launch profile.
Open SecurityDemo.App.http in your editor for ready-to-send requests, or
hit endpoints with curl:
curl http://localhost:5137/api/users
curl "http://localhost:5137/api/users/search?q=admin"
curl "http://localhost:5137/api/login/continue?returnUrl=https://example.com"Do not deploy this app. It contains SQL injection, IDOR, an open redirect, and other holes on purpose. Run it on your own machine only.
Workflow
Pick one or two high-value items and have the agent implement a fix:
- parameterized queries instead of string concatenation,
- replacing verbose exception responses with safe client errors and server-side logging,
- validating redirect targets against an allow-list.
Broken access control needs a larger fix: add authentication first, then enforce resource-based authorization against that authenticated identity. An ownership check without a trusted identity does not fix the IDOR.
Non-negotiables
- Do not paste API keys, connection strings, or PATs into the agent. Use
redacted samples or placeholders (
***). - Do not run exploit code against systems you do not own or do not have written permission to test.
- If the model suggests disabling CSRF, JWT validation, or HTTPS, treat that as a teaching moment and refuse unless the exercise is explicitly in a lab with no network exposure.
Done when
You have a short written summary: issues found, fixes applied with PR-sized diffs, and one process improvement (dependency audit cadence, SAST in CI, pre-commit secret scan) you would add next.