Mert Özen Go Beyond the Code

Blog

Posts and series that take software and IT from the basics to advanced topics: from programming languages and databases to architecture and AI.

Series
1990 posts found
Putting the OWASP Top 10 Together: Secure Defaults for ASP.NET Core and Angular
Security PART 17

Putting the OWASP Top 10 Together: Secure Defaults for ASP.NET Core and Angular

We put the ten categories together in a single Program.cs: fallback policy, cookie flags, ProblemDetails, rate limiting that returns 429, security headers and rejecting unknown JSON fields. We verify everything with curl, do SAST with the .NET analyzers, write security regression tests with WebApplicationFactory, and talk about DAST and moving to ASVS 5.0.

6 Nov 2026 13 min 88
OWASP A10: Mishandling of Exceptional Conditions — Fail Closed and ProblemDetails
Security PART 16

OWASP A10: Mishandling of Exceptional Conditions — Fail Closed and ProblemDetails

We start with a permission check that makes everyone an admin when the permission file cannot be read, a review endpoint that sends the SQL error and file path to the client, and a search that keeps running after the client has left. We fix them with fail closed, catching errors where they occur, IExceptionHandler and ProblemDetails, the .NET 10 handler logging change, request timeouts and cancellation.

6 Nov 2026 9 min 84
OWASP A09: Security Logging and Alerting Failures — What to Log, What Never to Log
Security PART 15

OWASP A09: Security Logging and Alerting Failures — What to Log, What Never to Log

We start with a login endpoint that writes wrong passwords to the log, lets a line break forge a record and never records 403s. We move to structured logging with LoggerMessage and the JSON console, make authorization denials visible, protect the email with HMAC redaction, tie the response to the log through traceId and look at which events deserve an alert.

6 Nov 2026 8 min 89
OWASP A08: Software or Data Integrity Failures — Deserialization and Mass Assignment
Security PART 14

OWASP A08: Software or Data Integrity Failures — Deserialization and Mass Assignment

We explain conceptually why letting incoming data choose its own type is dangerous, and show with real output how BinaryFormatter ends on net10.0 with a build error and a PlatformNotSupportedException. We set up allow-list polymorphism in System.Text.Json, close mass assignment with DTOs and JsonUnmappedMemberHandling, and look at code integrity through CI/CD and SRI.

6 Nov 2026 9 min 83
OWASP A07: Authentication Failures (2) — Cookie Flags, JWT Validation and CSRF
Security PART 13

OWASP A07: Authentication Failures (2) — Cookie Flags, JWT Validation and CSRF

We look at how identity is carried on every request after login. We set cookie flags and the __Host- prefix explicitly, explain the session fixation risk, validate issuer, audience, lifetime, signature and algorithm in JwtBearer, measure the effect of ClockSkew on an expired token second by second, and show how antiforgery and SameSite work together against CSRF.

6 Nov 2026 10 min 95
OWASP A07: Authentication Failures (1) — Brute Force, Lockout and NIST Password Rules
Security PART 12

OWASP A07: Authentication Failures (1) — Brute Force, Lockout and NIST Password Rules

We start with a login endpoint that accepts unlimited attempts and reveals whether a user exists through its message and its response time. We separate brute force from credential stuffing, compare Identity's default password rules with NIST SP 800-63B-4, fix it with a blocklist validator, lockout and a uniform response, and take a short look at MFA and passkeys.

6 Nov 2026 10 min 77
OWASP A06: Insecure Design — Business Logic Flaws, Race Conditions and Rate Limiting
Security PART 11

OWASP A06: Insecure Design — Business Logic Flaws, Race Conditions and Rate Limiting

An order endpoint that works correctly line by line refunds money for a negative quantity, accepts a single-use coupon twice and sells the last copy to two people. We separate design flaws from implementation bugs, find the missing requirements with STRIDE and abuse cases, and fix them with a conditional UPDATE, a transaction, .NET 10 validation and rate limiting.

6 Nov 2026 11 min 93
OWASP A05: Injection (2) — XSS, Razor Encoding, innerHTML, CSP and Trusted Types
Security PART 10

OWASP A05: Injection (2) — XSS, Razor Encoding, innerHTML, CSP and Trusted Types

We examine reflected, stored and DOM-based XSS in the Bookstore lab: HtmlEncoder and Razor's automatic encoding, the trap of writing a value from a JSON API with innerHTML and the textContent fix, Angular's sanitization and the bypassSecurityTrust* risk, then how CSP and Trusted Types stop unsafe code in headless Chrome as a second line of defense.

6 Nov 2026 8 min 102
OWASP A05: Injection (1) — SQL Injection and Command Injection
Security PART 09

OWASP A05: Injection (1) — SQL Injection and Command Injection

We write the same book search endpoint with string concatenation, an ADO.NET parameter, Dapper and EF Core, and see how a parameter turns ' OR 1=1 -- into plain data. We examine FromSqlRaw vs FromSql through the EF1002 warning and ToQueryString, use ArgumentList and an allowlist instead of a shell in Process.Start, and clarify where input validation fits with .NET 10's built-in validation.

6 Nov 2026 10 min 87
OWASP A04: Cryptographic Failures (2) — Password Storage, Data Protection and Secret Management
Security PART 08

OWASP A04: Cryptographic Failures (2) — Password Storage, Data Protection and Secret Management

How exactly does ASP.NET Core Identity's PasswordHasher store a password? We decode the hash header to see PBKDF2-HMAC-SHA512 with 100,000 iterations, move to OWASP's 220,000 with SuccessRehashNeeded, build a signed, time-limited share link with the Data Protection API, and keep secrets out of the code with user-secrets and environment variables.

6 Nov 2026 9 min 110
OWASP A04: Cryptographic Failures (1) — Encoding, Hashing, Encryption and HTTPS
Security PART 07

OWASP A04: Cryptographic Failures (1) — Encoding, Hashing, Encryption and HTTPS

Why Base64 is not encryption and how hashing differs from encryption. We catch tampered data with AES-GCM, use RandomNumberGenerator instead of Random for password reset codes, see why MD5 is wrong for passwords, turn on the CA5351 and CA5394 analyzers, and inspect HTTPS redirection and HSTS defaults in ASP.NET Core with curl.

6 Nov 2026 9 min 73
OWASP A03: Software Supply Chain Failures — NuGetAudit, npm audit and SRI
Security PART 06

OWASP A03: Software Supply Chain Failures — NuGetAudit, npm audit and SRI

Why is A03:2025 Software Supply Chain Failures its own category? Lessons from event-stream, Log4Shell, xz, polyfill.io and the 2025 npm incidents; NuGetAudit scanning transitive dependencies on net10.0, warnings that break the build, lock files, npm audit and npm ci, SRI for CDN scripts, an SBOM with CycloneDX, provenance and Dependabot.

6 Nov 2026 11 min 92
Blog Map