HTTPS, TLS and HSTS, CORS, XSS, CSRF, SQL injection, SSRF, clickjacking, open redirects, path traversal, insecure deserialisation, security headers and CSP, SameSite cookies and the OWASP Top 10.
-
Which security headers should an ASP.NET Core app send, and how do you roll out a Content Security Policy safely? Explain what each header protects against, how you set them in middleware, how CSP nonces work with Razor, and why you start in report-only mode.
The security headers that matter for ASP.NET Core apps and APIs, setting them in middleware, nonce-based CSP with Razor, and a report-only rollout.
Intermediate
Theory
Web Security
Β· π 2 follow-ups
-
How do you protect an ASP.NET Core API from oversized or deeply nested request payloads?
Mid-Level
Security
Web Security
-
What is the OWASP Top 10? Walk me through the current edition and tell me, for each category, what ASP.NET Core gives you by default and what you still have to do yourself.
The OWASP Top 10:2025 categories mapped to the built-in ASP.NET Core defences and the gaps a developer must still close.
Junior
Theory
Web Security
Β· π 2 follow-ups
-
How do HTTPS, TLS and HSTS fit together in an ASP.NET Core app? Explain UseHttpsRedirection and UseHsts, what HSTS preload means, why APIs are handled differently from browser apps, and what changes when the app runs behind a reverse proxy or Azure Front Door.
HTTPS redirection, HSTS and preload in ASP.NET Core, the API exception, and making them work correctly behind proxies and TLS-terminating load balancers.
Intermediate
Theory
Web Security
Β· π 2 follow-ups
-
Your React SPA on app.example.com.au calls your ASP.NET Core API on api.example.com.au and the browser console shows 'blocked by CORS policy', but the same request works in Postman. How does CORS and the preflight request actually work, how do you diagnose and fix it, why does AllowAnyOrigin with AllowCredentials fail, and why is CORS not a security control for your API?
Diagnosing CORS failures in ASP.NET Core: simple vs preflighted requests, policy configuration and middleware order, the wildcard-with-credentials rule, and why CORS relaxes rather than enforces security.
Mid-Level
Debugging
Web Security
Β· π 2 follow-ups Β· π 1 real-world
-
What is cross-site scripting (XSS)? Explain stored, reflected and DOM-based XSS, how Razor's automatic encoding protects you and where it doesn't (Html.Raw, JavaScript and URL contexts), how React and Blazor compare, and how a Content Security Policy limits the damage.
XSS types, Razor's context-aware encoding and its gaps, rich-text sanitisation, front-end framework escapes, and CSP as defence in depth in ASP.NET Core.
Mid-Level
Security
Web Security
Β· π 2 follow-ups Β· π 1 real-world
-
What is cross-site request forgery (CSRF)? When does using cookies make your app vulnerable, how does antiforgery work in ASP.NET Core MVC, Razor Pages and Minimal APIs, how should an SPA send the token, and how much does SameSite=Lax protect you on its own?
CSRF mechanics, when cookie authentication is exposed, ASP.NET Core antiforgery across MVC, Razor Pages, Minimal APIs and SPAs, and the limits of SameSite cookies.
Mid-Level
Security
Web Security
Β· π 2 follow-ups Β· π 1 real-world
-
How does SQL injection happen in a .NET application, and how do you prevent it in ADO.NET, Dapper and EF Core? Show the vulnerable and fixed code, explain why FromSqlRaw with string interpolation is dangerous, and how you handle things that can't be parameterised, such as a dynamic ORDER BY column.
SQL injection across ADO.NET, Dapper, EF Core and stored procedures: parameterisation, FromSql vs FromSqlRaw, identifiers that can't be parameters, dynamic SQL with sp_executesql, and least privilege.
Intermediate
Security
Web Security
Β· π 2 follow-ups Β· π 1 real-world
-
Your API lets customers register a webhook URL and also fetches profile images from URLs they supply. What is server-side request forgery (SSRF), why is the cloud metadata endpoint such a big target, and how do you defend against it in .NET, including redirects and DNS rebinding?
SSRF in features that fetch user-supplied URLs: the metadata and internal-service targets, why naive URL validation fails, connect-time IP checks with SocketsHttpHandler, redirects, DNS rebinding and network-level egress controls.
Senior
Security
Web Security
Β· π 2 follow-ups Β· π 1 real-world
-
What are open redirect and clickjacking vulnerabilities? Show how an open redirect happens with a returnUrl in ASP.NET Core and how LocalRedirect and Url.IsLocalUrl fix it, then explain how clickjacking works and how X-Frame-Options and CSP frame-ancestors prevent it.
Open redirects via returnUrl and how LocalRedirect/Url.IsLocalUrl prevent them, plus clickjacking and the X-Frame-Options and CSP frame-ancestors defences in ASP.NET Core.
Mid-Level
Security
Web Security
Β· π 2 follow-ups Β· π 1 real-world
-
What is insecure deserialisation, and why is it dangerous in .NET? Explain why BinaryFormatter was removed, why Newtonsoft.Json's TypeNameHandling is risky, how to do polymorphic JSON safely with System.Text.Json, and what other deserialisation risks remain (XML external entities, oversized payloads).
Insecure deserialisation in .NET: type-controlled formatters and gadget chains, BinaryFormatter's removal in .NET 9, Newtonsoft TypeNameHandling, safe polymorphism with System.Text.Json, XXE and denial-of-service limits.
Mid-Level
Security
Web Security
Β· π 2 follow-ups Β· π 1 real-world
-
Explain SameSite cookies. What do Strict, Lax and None actually do, what counts as the 'same site', why does an OpenID Connect sign-in break if the correlation cookie is Lax, and how have browser changes (Lax by default, third-party cookie blocking) affected ASP.NET Core apps?
SameSite=Strict, Lax and None semantics, the site vs origin distinction, cross-site flows such as the OIDC form_post callback, ASP.NET Core cookie settings, and the browser changes that broke older apps.
Mid-Level
Theory
Web Security
Β· π 2 follow-ups Β· π 1 real-world
-
Code review: an ASP.NET Core invoices controller has a search action that concatenates the customer name and sort column into a SQL string, a Void action that loads any invoice by id with no ownership check and then redirects to a returnUrl from the query string, and a catch block that returns ex.ToString() to the client. What do you flag, in what order, and what does the fixed version look like?
A security-focused code review of an ASP.NET Core endpoint with SQL injection, broken object-level authorisation, an open redirect and verbose error disclosure, ranked by severity with a full rewrite.
Senior
CodeReview
Web Security
Β· π 3 follow-ups Β· π 1 real-world