Writing Secure Code in the AI Era

3 days
UWSEC
3 days

Upcoming Sessions

Date:

Format:

Price:

Location:

Book now

Date:

Format:

Price:

Location:

Book now

Date:

Format:

Price:

Location:

Book now

Date:

Format:

Price:

Book now

Need a private training for your team?  Request a private training

Not ready to book yet?   Request an offer

Part 1: Web Security Fundamentals in the AI Era

Cybersecurity Foundations, AI-Powered Threats and OWASP Top 10

This chapter introduces the fundamental concepts and terminology of web security. It explains why web security is important, how web applications are commonly attacked, and which core principles are used to protect them. The goal is to establish a shared vocabulary and security mindset that will be used throughout the rest of the course, including the risks introduced by AI-powered attacks and AI-assisted development. The OWASP Top 10 provides a reference for the vulnerabilities and mitigations covered throughout the course.

  • Why Web Security Matters in the AI Era
  • AI-Powered Attacks and Automated Vulnerability Discovery
  • Threats, Vulnerabilities, and Risk
  • Basic Security Principles
  • How the Web Works from a Security Perspective
  • Authentication and Authorization
  • AI-Powered Bots, Automation Abuse and Rate Limiting
  • Introducing the OWASP Top 10 and General Mitigation Techniques

Encryption, Hashing and Signing

This module introduces the cryptographic concepts developers need to protect application data and communications. You will learn how to apply encryption, hashing and digital signing correctly in .NET, enforce HTTPS and securely store passwords.

  • Encoding - Hashing - Encryption - Digital Signing
  • Symmetric Versus Asymmetric Encryption
  • Secure Communication with HTTPS
  • Encryption in .NET
  • Properly Store Passwords with Hashing and Salts

Part 2: Browser-Based Security for Traditional Web Apps

Authentication, Authorization and Session Security

This module explains how authentication and authorization are implemented in traditional server-rendered web applications. We focus on browser-based security patterns, showing how users are authenticated, how identity information is stored and propagated, and how access to application functionality is enforced on the server. Emphasis is placed on secure defaults, real-world deployment scenarios, and avoiding common access control pitfalls, including insecure cookie configuration and session hijacking.

  • Ways of Authentication: Passwords, MFA, Passkeys, ...
  • Cookies as the Session Mechanism (and Why)
  • Secure Cookie Configuration and Session Hijacking Prevention
  • Claims-Based Identity in ASP.NET Core
  • Authorization Policies vs Roles
  • Authentication Failures
  • Broken Access Control, Including in AI-Generated Code
  • OpenID Connect Login Flow using Entra ID
  • Introducing JWT Tokens
  • LAB: Protecting Your Website

Forms and State: CSRF, Overposting, and Validation

Server-rendered forms introduce classic web risks: CSRF, mass assignment / overposting, and validation issues. You'll learn how these attacks work and how to prevent them.

  • How CSRF Works
  • Anti-Forgery Tokens and SameSite
  • Overposting / Mass Assignment Risks
  • Input Validation, Output Encoding, Sanitization and Deserialization
  • LAB: Protecting Against CSRF and Overposting

Data Access in Server-Rendered Web Apps: SQL Injection and Safe Data Handling

When your application talks to a database, injection becomes a primary risk. We cover how injection happens in .NET, how to avoid it using parameterization, and what ORMs do and don't protect you from. We also look at how database security (accounts, permissions, and configuration) limits the blast radius when something goes wrong, including when applications execute AI-generated queries.

  • Database Security
  • SQL Injection Mechanics
  • Parameterization (using EF Core)
  • Security Risks of AI-Generated SQL
  • LAB: Injecting SQL in a Vulnerable Website

Part 3: Identity and Authorization Beyond the Browser

Protecting APIs with OAuth2, JWT Access Tokens and CORS

OAuth2 is the standard for delegated authorization. We focus on protecting ASP.NET Core APIs using Entra ID, validating tokens, and implementing authorization using scopes/claims. These principles also apply when AI-powered applications and agents consume APIs. We also cover secure cross-origin access from browser-based clients.

  • Why Cookies Don't Fit Every Client
  • OAuth2 Overview (Scopes, Audiences, Clients)
  • Access Tokens and Refresh Tokens
  • JWT Validation Basics
  • Scopes, Roles, and Claims in APIs
  • Least-Privilege API Access for AI Applications and Agents
  • OAuth2 using Entra ID
  • Same-Origin Policy and CORS Configuration
  • Preflight Requests and JavaScript CSRF Risks
  • LAB: Protecting and Consuming Your API, Including CORS

Part 4: Client-Side Security and Browser Attack Surfaces

Script Injection: XSS and Content Security Policy

Script injection is one of the most damaging browser-based attacks. This module explains reflected/stored/DOM XSS, and focuses on practical mitigations: encoding, safer templates, and CSP.

  • XSS Types and Attack Paths
  • Output Encoding in Server-Rendered Views
  • Safe Handling of Untrusted HTML and AI-Generated Markdown
  • Content Security Policy Fundamentals
  • LAB: Protecting Against Script Injection

Securing Single-Page Applications

Single-Page Applications have a different security profile than traditional server-rendered applications. Since SPAs run entirely in the browser, they cannot safely store secrets and rely on API calls for all backend interaction. This makes secure authentication and token handling essential. Modern SPA security therefore uses OAuth 2.0 with PKCE for public clients to prevent token interception, and often applies the Backend-for-Frontend (BFF) pattern to move token handling and sensitive logic to a trusted server, building on the security concepts already seen in server-rendered and API architectures.

  • Use OAuth 2.0 with PKCE for Public Clients, Including SPAs and Mobile Applications
  • Use a Backend-for-Frontend (BFF) Pattern to Handle Tokens and Sensitive Logic Server-Side
  • DEMO: Secure Token Handling with the BFF Pattern

Part 5: Secure Software Development in the AI Era

Secure Coding with AI Assistants

AI coding assistants such as GitHub Copilot can accelerate development, but generated code is not necessarily secure. This module explores how developers can identify common vulnerabilities in AI-generated code and use AI to support security reviews without replacing human judgment.

  • Security Risks of AI-Generated Code and Suggested Dependencies
  • Protecting Source Code, Secrets and Sensitive Data
  • Software Supply Chain Security in DevSecOps CI/CD Pipelines
  • AI-Assisted Code Reviews and Security Testing
  • Validating AI-Generated Code and Security Recommendations

Securing AI-Powered Applications and Agents

Applications that integrate large language models and AI agents introduce new attack surfaces. You will explore common AI security risks and learn how to apply existing secure coding and access control principles to protect these applications and their data.

  • Introducing the OWASP Top 10 for LLM Applications
  • Direct and Indirect Prompt Injection
  • Sensitive Information Disclosure and Insecure Output Handling
  • Excessive Agency and Least-Privilege Tool Access
  • Guardrails and Human Approval for Sensitive Actions
  • LAB: Reviewing AI-Generated Code and Securing an AI-Powered Application

Artificial Intelligence is transforming the way software is developed and the way applications are attacked. Attackers can use AI to identify vulnerabilities and automate cyberattacks, while AI-powered coding assistants can introduce security weaknesses into otherwise functional code. As a modern developer, mastering secure coding practices is more important than ever.

In this hands-on course, you will learn how to protect modern web applications against traditional and AI-powered cyberattacks using ASP.NET Core. You will learn how to authenticate with OpenID Connect and Entra ID, protect your API with OAuth2 and secure your data with proper encryption techniques. Starting with server-rendered websites and progressing to APIs, modern JavaScript and AI-powered applications, you will gain practical experience in secure application development. You will also learn how to review AI-generated code for vulnerabilities, use AI coding assistants responsibly and secure applications that integrate large language models and AI agents.

This course is designed for developers with experience in ASP.NET Core who want to build secure applications and protect them against modern cyber threats, including developers who use AI-powered coding assistants. No prior experience with cybersecurity or AI application development is required.

Contact Us
  • Address:
    U2U
    Z.1 Researchpark 110
    1731 Zellik (Brussels)
    BELGIUM
  • Phone: +32 2 466 00 16
  • Email: info@u2u.be
  • Monday - Friday: 9:00 - 17:00
    Saturday - Sunday: Closed
Say Hi
© 2026 U2U All rights reserved.