Secure by Design: Integrating Security into Development

Why Front-End Engineers Must Own Security

The speaker opens by framing security as an inevitable responsibility for front-end and full-stack developers, sharing a personal journey from ignoring security to being handed penetration test results. The talk scope is defined: application security specifically, touching on design, coding practices, and AI, while acknowledging the broader security landscape from hardware to human factors.

The Current State of Cybersecurity and CVE Trends

The speaker introduces CVEs (Common Vulnerabilities and Exposures) and MITRE, explaining how major organisations like Google and Red Hat contribute to a shared vulnerability database. A 2025 graph shows recorded vulnerabilities are already matching 2021 levels by June, illustrating the accelerating scale of the problem and distinguishing between discovered, fixed, exploited, and zero-day vulnerabilities.

Secure by Design: Principles and International Frameworks

The speaker defines Secure by Design as embedding security as a core business requirement from the design phase, not as an afterthought. A 2023 joint initiative by CISA and 17 international partners including Australia established foundational principles: resilient products out of the box, secure defaults, and complexity that is never the user's burden. Practical tactics covered include a security-first mindset, staying current with CVEs, vulnerability disclosure policies, and transparency when breaches occur.

OWASP and Building a Secure-by-Design Project Template

The speaker introduces OWASP (Open Worldwide Application Security Project) as a key reference, highlighting its top-10 web security risks, web security testing guides, and technology-specific cheat sheets for JavaScript, Java, and API hardening. These resources form the basis for a structured Secure by Design project template, started in Git, that provides roughly 20 security tasks developers can apply before writing a single feature.

Dependency Security, Secret Management, and Vulnerability Disclosure

The speaker walks through three foundational project security tasks: scanning for outdated or malicious npm dependencies (citing a critical DomPurify vulnerability still affecting 16% of downloads), managing secrets safely using platform variables and pre-commit hooks via tools like GitGuardian, and establishing a security contact using security.txt and GitHub's security policy (SECURITY.md). AI-generated hallucinated package names are flagged as a new attack vector for malicious npm packages.

Authentication Hardening and Security Headers

The speaker covers authentication best practices including multi-factor authentication, login attempt limits, session controls, auto-logout, and preventing username enumeration. Security headers are then examined — including Content Security Policy as a browser-side firewall controlling which scripts, styles, and images are permitted — with live examples from WordPress and ChatGPT. The Permissions-Policy header is demonstrated using Facebook's permissive configuration as a cautionary example.

API Security, File Uploads, and Production Readiness

The speaker addresses API-specific security risks using the OWASP API Security project, covering rate limiting, misconfiguration, and excessive data exposure, with a note on disabling unused WordPress REST APIs. Additional tasks include validating uploaded files with antivirus scanning, using CAPTCHAs, and following Australian Cybersecurity Centre guidelines for production readiness: segregating environments, restricting production access, configuring CDNs, and disabling super-admin users.

Secure Coding Practices for JavaScript and the Browser

The speaker outlines front-end threat vectors — forms, cookies, query strings, local storage, third-party APIs, image metadata, and user-provided links — and demonstrates safe coding patterns in React, Angular, and Vue. Key guidance includes using default data binding over innerHTML, sanitising any dangerously set HTML with DOMPurify, validating URLs against javascript: schemes, and using security linters. Real-world CVE examples are shown for SQL injection in WordPress, broken access control in Next.js caching, XSS via SVG uploads in Craft CMS, and prototype pollution in a Vue i18n package.

AI Tools, Security Awareness, and a 6-Month Action Plan

The speaker compares AI coding assistant outputs on a WordPress sanitisation task, showing improvement between GitHub Copilot six months ago and current ChatGPT and Gemini responses. A caution is raised about Chrome's AI console feature sending page data to Google. The talk closes with a tiered action plan: subscribe to security advisories and audit dependencies this week; scan codebases and run monthly security reviews within three months; and dive into OWASP cheat sheets, start a Secure by Design project, and pursue security champion training within six months.

Welcome, everyone. Thanks for introduction, John, and, welcome to Secure by Design talk. So, let's talk about security, and let's have a look at the agenda. So why do we need to focus on the security as a front end engineers or as a full stack engineers as the front end engineers sort of trickles down to the full stack.

We'll have a look quickly at the state of cybersecurity at the moment and what is secure by design principles and start building a project as a secure by design with secure by design fundamentals. After that, we'll look at the secure coding practices and as well look at the big elephant in the room, AI and security, and walk through the action list quickly.

So why do we need to care about security? I started somewhat some years ago, and as a web developer had zero interaction with security or zero afterthought about security. Do I need to do it? I just need to do this combo box this way and this feature this way. But as you progress in your career, someone will hand you penetration test for your application or maybe somebody else's application and say, hey. Fix all these issues.

And once you see it develop this beautiful application, how do you prepare it for a penetration testing as well? What steps do you need to take? And what actually happens when your application is compromised? Do you even know that it's compromised? One can be one way to know what it was compromised is observability as David was talking about. But let's so it always felt like security was afterthought.

And security scope of security is huge. It goes from physical hardware security, from network security, infrastructure clouds, things on application, data, how to store your data, is it safe, how to store your backups, human security, don't get caught by phishing attempts.

In this presentation, I'll just focus on application security, although sometimes it may intercept with other levels. So we'll focus on application design stage. For the state of security, it's quite easy to see if you're familiar or not with CVEs and with MITRES.

So that's an organization with American Cybersecurity Infrastructure Agency and with Google, Red Hat, all the big companies that they try to put all the vulnerabilities they found in their public products into one database. And CVE is a vulnerability that they discover, so they give it specific number and severity and what it affects.

So if we look quickly at the at the graph in 2025, so what is it? June, we're already at the level of 2021. So this is how many recorded CV vulnerabilities that have been discovered and probably fixed. Some of them have not been fixed.

Some of them are zero day vulnerabilities that actually were exploded. And not every vulnerability means that it was exploited either. So looking at this stage, what is secure by design? Security Secure by Design is sort of a concept where we'll build in the security as a core business requirement rather than afterthought.

So we'll focus on the security and the design phase of the product development. In October 2023, already a couple of years ago almost, American cybersecurity infrastructure agency and 17 other United States and international partners, including Australia, got together and said, like, let's build the secure by design principles.

So it was a really good timing for that. And what are they focusing is that product should be resilient out of the box, secure configuration should be baseline, and the complexity of the security should not be users' problem. It's like when you buy a car, you don't buy seat belts separately and then try to fit them.

So it comes together with the car. So in the same place, when you buy Internet of Things device or that camera, there should not be a default password that everyone else in the world knows. And actually, last year, in 2024, after decades of default passwords, UK laws banned default passwords on those kinds of devices.

So it took a while. And the tactics to implement the secure by design is security first mind mindset. So be aware of what's happening. So know your CVEs. Subscribe to the mailing list of what's happening in the in the world.

Design your products with the security in mind. Follow the secure software development principles. Embrace transparency. So if you have been breached, if your application have been breached, make sure to notify your users in time. Don't hide that. And also make sure if someone knows or someone discovered vulnerability in your application, maybe let them easy way to find that to to let you know that, there is a vulnerability, so implement the vulnerability disclosure procedure and policy.

Australian government also wasn't behind that. So this was updated in December. Maybe it was updated even later on. I haven't looked at the website lately, but I think it's still there. So you've got the application development guidelines from Australian Cybersecurity Center. So it has just quite good some good pointers.

The other publication that I was based in my Secure by Design project is Open Worldwide Application Security Project, which is OWASP. You might have heard about it. They compile every now and then top 10 for web application security risks. So it's how the applications are being hacked.

Also, they have a really good guides for web security testing. So you can actually have a look at the guide and prepare for penetration tests. And they have a lot of good chitchits. So the chitchits are based on the technology and how to, implement the best practices for that one particular technology, would it be Java, JavaScript, or API hardening and things like that so that you get the information that you know what is being tested in pen test and what hackers are looking at.

So let's start our secure by design project. Based on those publications, we'll put them in a task, and in the end, we'll have a template of the project that actually has all the security features. Not all of the security features, but basic security features.

You might need more. You might need less. We'll start that in Git, and I'll be putting all these tasks into Git. If you don't use Git, use Git. There are still people who don't use Git. Yes. So first one, create a new project.

And while you're setting up the project, you React or Vue, you have continuous deployment and integration setting up. You have LinkedIn. You have testing and other things. And GitHub and GitLab provide automated security testing. So static analysis security testing comes for free.

Dynamic security testing, you might have to pay for it, but it's a really good example of how you can build in some security scanning tools straight there out of the box with your git repository. And also, don't forget to scan for outdated dependencies even before you start the project because who uses Dumpurify?

There was a critical vulnerability in October. And every week, there's 10,000,000 downloads of this DomPurify library, and about 16% are still critically vulnerable. So that's a pretty bad indication.

And even version one is still downloaded every week 14 times, which is why? Update your dependencies. And also beware of malicious packages. There is if you have a look at Snyk, it's one of the security companies that provide a lot of security resources.

They show about a dozen of every day of malicious packages removed from NPM. And thanks to AI, we have slots guarding all the hallucinations. Hackers pick them up, create a quick NPM package based on somebody else's hallucinated NPM package.

And here you go. You can actually import a malicious package into your development. So next issue, keep your secrets yours. We all use API keys, SSH keys, things like that. So make sure they're not committed to your public or private GitHub repo. So have there are a couple of examples here of how it can affect pretty badly in the last couple of years.

So make sure you create and document secret management and what's the procedures on how do you use your secrets. Designate a system for the secrets. You can keep your secrets in GitHub or GitLab. There are specific variables for it. Make sure there is a distinguishing between production and test secrets so they don't link to each other.

You can also have a pre commit hook that checks if there are any secrets that have been committed into your repo. There is a company that is called GitGuardian that can provide that service. And do not log your secrets. Maybe you've heard Facebook in 2020 in 2019, they were discovered millions of users in in a database, usernames and passwords in clean, text.

They were just collecting logs like that. So don't put any of the secrets in the logs. They will leak. So the next, how does one report security issue of your web application? How do they contact? Who they contact? And there is a answer for that.

So security TXT. If you don't have it, install it. It's quite an easy thing to do. Here's the Google's one. It can live in well known directory or it can live in its own directory, just its own file. You might find a job in Google with security.

They have a couple of positions open in Sydney, or you can win a couple of $100 if you find their vulnerabilities. So in our task, in our little project, that's something to do. So you need to designate the security contact email, who's going to monitor it. Also, GitHub provides security MD.

Does anyone have a security MD on their project? So this is a security a a feature of actually showing you show showing your users or your developers if it's a private repo of your custom security policy. Or you can go as well and subscribe to HackerOne.

For example, Stripe has a very interesting hacktivity. They usually have very small, bonuses for finding hacks. In a couple of months, they were, like, under $1,000. But a month ago, there was someone found something on Stripe and was paid $23,000. So it must have been quite a substantial vulnerability.

So this is just the test to implement the security TXT because it has to be signed. It's not just a text file. Otherwise, a hacker can come in and just put plunk a file in. Now it has to be signed. Authentication. If you are building something with the framework, you might already have some authentication capabilities out of the box.

If you are building your own brand new React app, what your authentication might be. So you can harden your authentication with enabling multifactor with limited login attempts. Number of sessions may be limited. Maybe enable auto logout, prevent username enumeration.

So if someone types in, an email, don't tell specifically, oh, this email doesn't exist here or this email exists. So all these things you can implement to enhance your authentication procedures. And that's also part of the WASP testing for authentication issue, part of the penetration testing.

So the next one is, where is your head? Where is your security head? That doesn't look good. So security headers are not a new thing. The content security policy have been has been there for, like, ten years already. It hasn't been used widely. So look at the security headers, test your web application at the securityheaders.com and see what's missing in your particular application and what would might require to your next application.

This one is work in progress for WordPress. This is a content security policy for Chad GPT. They have a very extensive one that goes off the page. So content security policy is like a firewall for your JavaScript and all the other resources on your web page.

So do you allow external JavaScript from which domains? Do you allow styles from where images? Things like that. So you can really safeguard the browser with that the users are using. Another interesting header, is permission policy.

So permission policy allows the website to use all the APIs, geo geo location, microphone, camera. So this one is Facebook. So that's why they're listening to you. Everything is enabled. Everything is allowed. A lot of pentests return and saying, oh, you're actually using WordPress, or there's an x generator that says WordPress or Drupal or PHP.

And this is sort of security by obscurity task. They say, can you remove this header? Well, okay, let's add it to the list. API. Yes. It's once you open the API, it's another level of security that you need to think about and also GraphQL if you're using that. So the security megatask comes from the separate project from OWASP.

It's a project API security. So it's all these different features that you have to think about when you're implementing APIs. Is there rate limiting? Is there misconfiguration a misconfiguration possibility? Possibility? Is Is there there excessive data exposure and things like that? If you are using WordPress, WordPress has API enabled by default.

Maybe you don't need this if you are not using it as any with any React components or anything like that. So maybe just you can disable it so that there is less possibility for some plug in that doesn't use the proper roles and authentication, we can expose the data.

And there were a couple of vulnerabilities like that. Looking at some additional security features, don't trust files that are being uploaded, always use an antivirus or configure an antivirus on your back end. Use captures. If someone tried to access this form a couple of times, maybe ask them if they're human.

And another last task for this one is production readiness. Are you ready? So according to Australian Cybersecurity Center, they have a couple of really good points. Development, testing, and production environments are to be segregated, so don't use your test same database for test and production.

And also development and modification of software should only take place in the development environment. So don't hack in production. Just ship it and forget about it there. If you need to develop, create change, merge request and so on. So that if you have that access to production, maybe someone else might get. And there are other tasks to go live.

Configure CDN, they're free now, and restrict access to file systems or disable super admin users. So you can go through the checkbox and see which one applies to your applications and which one maybe doesn't and which one maybe is a good idea to implement.

So this is about 20 tasks of secure by design project. So it's there is nothing written yet. There is no even features of this project, but you can try to estimate how long it will take to build security into that project. So it helps with security compliance, project estimation, and preparation with pen test as well.

So let's look at the secure coding practices, especially for the front end for JavaScript and things. The front end is the main threat factor is just the browser based attack. So it's the user sitting on the other side, either through the browser or curls.

So it's our code. If we put the CDN in front, we can fix it. All of it? No? Maybe? So what's the browser based attacks? Don't trust the malicious code and any input. So what can input be? Forms data, query string, cookies, HTTP headers.

They they can be modified by the malicious actors. Local storage, client databases, third party API responses, might not be trustworthy. Also, if you have specific features, you might think about that as a input. If you're extracting metadata or names from the images and then you're displaying that, can you trust that data?

Or if you are doing text recognition on images and the image contains a malicious script, Maybe not worth trusting this data either. Also, user provided links. Did they actually put HTTPS or did they put JavaScript in there or upload in files? So when you start a new project, just make sure you use a framework. They have already a lot of people, a lot of testers, a lot of users who put the best practices in the security. Do not trust user input.

Make sure your SQL is clean and parameterized and code output. And the frameworks also prevent with cross site request forgeries, but you have to make sure you use that. It it's not there by default. It's there by default, but you have to use it. So the quick recap of JavaScript.

So first line is React. Do use default data binding and inner text in Vanilla JS, and don't use unsafe HTML access, like inner HTML. Yeah. Free for all. Also, if you do have to use dangerously set inner HTML, and this is React, specifically, named it so that it's dangerous.

There are other in Angular and Vue. They have their own alternatives to that. Make sure you purify that input, that output. And also if you have to display the URLs, make sure you validate the URLs that are not JavaScript URLs.

And, of course, you have your lints at the security lint just to make sure that you don't have evals or console logs or debuggers in the in your production code. So this is a a console log of a very large Australian travel agency. I don't know why.

It's in production. Maybe I wonder if they have security TXT. I haven't checked that. So quick examples of vulnerabilities in the wild. SQL injection, which is not very common at the moment because unless you're using not a framework, although I don't know if WordPress is a framework or not.

So this is WordPress example. Open file listing opens user file, and just every row is being added into a table, concatenated. So, yeah, it can backfire. So basically, in this particular framework, prepared state statements. So it's, we'll clean that up.

Broken access control sometimes, is not that easily, visible. So this is, also very val very highly severe vulnerable, CV from, Next. Js of, zero SDK.

Doesn't look anything like there's wrong with that. But the caching. So even if you are using framework, you need to know the deep dive deep structure of it. So what the header is, especially when you are logging into something. Don't cache those responses.

So maybe something to look into your own applications. XSS injections, make sure you encode your outputs. So this is an example from Craft CMS. Try this at home. So this is jsfword.com.

So it outputs JavaScript in this format. See if it will work. See if you can access your own website. Try this. Can you if your website allows uploading of SVG, will that be uploaded?

Yeah. JavaScript gives us prototypes and also with that prototype pollutions. So in this case, that's a proof of concept for view internalization module package and simple fix, but really high severity issue.

So how to practice all those issues? Just go to cv.org, find a couple of issues, see the because it's all mostly things are open source, find the commit and see how it was fixed. Check your own code. Maybe there is a similar vulnerability there or similar practice.

And, last thing is AI and security. So, let's have a little prompt in WordPress, the query parameter to a cookie. So six months ago, this was a reply from GitHub Pilot. Not so great. It just takes the parameter from query string and puts it directly into a cookie. Yesterday, ChatGPT did that.

So it actually sanitized the cookie, sanitized text field. It's WordPress for it. It also writes you an explanation saying we're making sure there is no bad code in there. And I asked Gemini, it's like, are you sure we need that?

And it's like, absolutely. So good on you, AI. Another thing, have you enabled AI assistance in Google Chrome? Do you know if there that there is a feature like this? So you can ask in console. You can ask, can you put the button to the right or couldn't so you can interact with Gemini in console of Google Chrome.

But have you read things to consider? So all this data is being sent to Google. So don't enable it on your Nedbank account. Yep. So let's recap quick action list for the next week. Subscribe to a security advisory if you are not yet to your particular technology and look through the publications and see if you have any dependencies that are out of date.

Within the next three months, scan your code base for code security issues, brush up on the coding standards, maybe have a once a month security discussions, what's missing in your web applications, and review your project based on the secure by design tactics and tasks. Maybe something will get into your backlog.

And for the next six months, dive deep into cheat sheets and security testing guides. Fascinating read. Also, start your next project, the Secure by Design project, and maybe start online security training and become a security champion, whether you're on front front end or back end.

And thank you. All the resources are there.

Agenda

  • Why?
  • State of cyber security
  • What is Secure by Design?
  • Secure by Design project
  • Secure Coding Practices
  • AI and security
  • Action list

Why?

  • Have you ever received a penetration test result?
  • How do you prepare for penetration test?
  • What happens if your web application is compromised?
  • How do you even know it has been compromised?

Security feels like an afterthought :/

Scope

Cybersecurity should be applied on multiple levels:

  • Physical: hardware, wires
  • Network: cloud, infrastructure, systems
  • Application
  • Data
  • Human

In this presentation the focus is on application-level security tactics, although sometimes the levels can intercept.

State of security

The mission of the CVE® Program is to identify, define, and catalog publicly disclosed cybersecurity vulnerabilities.

Backed by:

  • Cybersecurity and Infrastructure Security Agency (CISA, USA)
  • MITRE, including Google, Red Hat, INCIBE (Spain), JPCERT/CC (Japan), and many other organisations

CVE = Common Vulnerabilities and Exposures

State of cyber security

Number of CVEs by year

CVE = Common Vulnerabilities and Exposures

Source: CVE Details

A bar chart shows annual CVE counts generally rising from about 6,000 in 2015 to nearly 40,000 in 2024. The partial 2025 count already exceeds 20,000.

What is Secure by Design?

Security of the customers is a core business requirement (not just a technical feature).

Secure by Design

Secure by Design initiative

By Cybersecurity and Infrastructure Security Agency (CISA, USA) and 17 U.S. and international partners.

Launched in October 2023

Logos identify participating cybersecurity agencies from the United States, Australia, Canada, the United Kingdom, New Zealand, Germany, the Netherlands, and other partner nations. A report cover reads “Shifting the Balance of Cybersecurity Risk: Principles and Approaches for Secure by Design Software.”

Secure by Design

  • Products should be resilient out of the box
  • Secure configuration should be the default baseline
  • Complexity of security configuration should not be a customer problem

Built-in safety features, like seatbelts, are included in all new cars.

Secure by Design Tactics

  • Security-first mindset:
    • education and awareness
    • security included in the design phase of product development
  • Secure software development principles
  • Implement default security features
  • Embrace transparency and accountability
  • Implement vulnerability disclosure policies

Extra

  • Catalogue of Product Security Bad Practices — fun read!

Australian Gov’t Guidelines

Guidelines for Software Development

By Australian Cyber Security Centre (ACSC)

December 2024

A screenshot of the Australian Signals Directorate website shows the “Guidelines for software development” resource, including guidance for application development and the separation of development, testing, and production environments.

Technical Guidelines

Open Worldwide Application Security Project (OWASP)

  • Provides tools and resources to prevent and mitigate cyber attacks
  • OWASP Top 10 of most critical security risks to web applications

Web Security Testing Guide

  • Provides a framework of best practices used by penetration testers
  • Pick and choose development-specific items

Cheat Sheets

  • Guidelines and best practices on various security topics

Secure by Design Project

Let’s start a new project based on Secure by Design principles, tactics, practices and technical guidelines.

Project setup

Always use source control:

  • GitHub, GitLab, BitBucket (or other)
  • Never lose your code
  • Track code changes
  • Use the tools provided!

Let’s create security-first project tasks!

Enable scanning

Automate security of your project by enabling:

  • scanning for outdated dependencies
  • SAST (static analysis security testing)
  • DAST (dynamic analysis security testing)

Two project cards turn application security testing into tracked work: “Enable SAST” and “Enable DAST,” both categorized as security tasks.

Scanning for outdated dependencies

CVE-2024-47875: DOMPurify: Nesting-based XSS

Severity Score: 10.0 · Critical
Date fixed: Oct 11, 2024
Affected versions: < 2.5.0 and < 3.1.3

Downloads of DOMPurify for June 03–09, 2025

All versions: 10 M
< 2.5:       1.1 M (11%)
< 3.1.3:     500 K (5%)
v0.4.0:      14 (released 11 years ago!)

Beware of malicious packages

Before installing a new package:

  • Check its weekly downloads and latest release
  • Check whether it is in active development and its documentation is up to date
  • Beware of slopsquatting:
    • AI vibe coding may hallucinate package names that do not exist
    • Threat actors may use those names to create malicious packages
  • Snyk reports dozens of malicious npm packages every day: security.snyk.io/vuln/npm

Keep your secrets yours!

  • 38TB of data accidentally exposed by Microsoft AI researchers: SAS token was committed to a public GitHub repository (18/09/2023)
  • Web Help Desk Hardcoded Credential Vulnerability (CVE-2024-28987) (22/08/2024): “hardcoded credential vulnerability, allowing remote unauthenticated user to access internal functionality and modify data”
  • Cisco takes DevHub portal offline after hacker publishes stolen data (15/10/2024): “the files not intended for public download were inadvertently published”

Secrets storage

Secrets such as API keys, access tokens, and passwords must not be committed to Git:

  • Document secrets management and the local development process
  • Designate a system for secrets storage
  • Distinguish between production and test secrets
  • Add a pre-commit hook to detect secrets
  • Do not log secrets!

A project card records the implementation task “Define and configure secrets storage.”

How do I report a security issue?

If someone discovers a security vulnerability:

  • How can they contact you?
  • What is your security policy?
  • Who is responsible to review and respond to the reports?

Do you have a security.txt?

Security.txt

Contact: https://g.co/vulnz
Contact: mailto:security@google.com
Encryption: https://services.google.com/corporate/publickey.txt
Acknowledgments: https://bughunters.google.com/
Policy: https://g.co/vrp
Hiring: https://g.co/SecurityPrivacyEngJobs
Expires: 2030-04-01T00:00:00Z

A browser screenshot shows Google’s published /.well-known/security.txt file, providing vulnerability-reporting contacts, encryption information, policy and acknowledgments links, and an expiry date.

Develop security policy

  • Designate a security contact email
  • Develop procedures and processes
  • Define scope for security issues
  • Utilise tools, such as GitHub SECURITY.md
  • Bonus: engage external testers in a bug bounty program, such as Stripe on HackerOne

A project card defines the task “Vulnerability disclosure program: develop policies and procedures.”

Vulnerability disclosure program

  • Implementation of policy task #2
  • Configure a security.txt file
  • Examples: Craft CMS and CISA
Contact: mailto:security@example.com
Expires: 2025-01-01T00:00:00Z
Acknowledgments: https://www.example.com/security
Preferred-Languages: en
Policy: https://www.example.com/security

A development task card titled “Vulnerability disclosure program: Enable securitytxt” points to an implementation checklist and a sample security.txt configuration.

Authentication

  • Implement a reputable identity management framework:
    • Avoid custom identity management
    • Avoid plain-text password storage
  • Develop a strong password policy:
    • Password length and strength
    • Do not allow password reuse
  • Enable multi-factor authentication
  • Limit login attempts
  • Limit number of sessions
  • Enable automatic logout
  • Prevent username enumeration
  • Follow OWASP WSTG-ATHN-01 to 10: Testing for Authentication issues

Two project cards separate the work into developing a strong password policy and implementing enhanced user security.

HTTP Security Headers: N/A

A Security Headers report gives the University of Queensland website an F grade. It marks Strict-Transport-Security, Content-Security-Policy, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, and Permissions-Policy as missing.

Configure HTTP Security Headers

  • Strict-Transport-Security
  • Set-Cookie
  • X-Frame-Options
  • X-Content-Type-Options
  • Referrer-Policy
  • Content-Security-Policy
  • Permissions-Policy

Test which headers to configure: securityheaders.com

A project card records the development and security task “HTTP Headers: Configure HTTP Security Headers.”

HTTP Security Headers: WIP

A Security Headers report gives WordPress.org a D grade. X-Frame-Options is present, while Content-Security-Policy, X-Content-Type-Options, Referrer-Policy, and Permissions-Policy are missing; Strict-Transport-Security receives a warning.

Content Security Policy

Content Security Policy (CSP) is an effective measure to protect your site from XSS attacks.

By whitelisting sources of approved content, you can prevent the browser from loading malicious assets.

ChatGPT’s content security policy

An extensive real-world CSP example from ChatGPT lists separate approved sources for scripts, images, styles, fonts, connections, and other resource types, illustrating the breadth and specificity a production policy can require.

Permissions policy

Permissions Policy is a header that allows a site to control which features and APIs can be used in the browser, including geolocation, microphone, and camera.

Facebook’s permissions policy

A long Facebook Permissions-Policy example assigns access rules to many browser capabilities, including camera, microphone, geolocation, clipboard, fullscreen, payment, display capture, and device sensors.

Fingerprinting web application

HTTP headers can disclose which CMS or web server is used.

Fingerprint headers include:

  • X-Generator
  • X-Powered-By
  • X-Platform

Security via obscurity is not security—there are other ways to determine which CMS is used.

A project card tracks a mitigation task to reduce fingerprinting of the web application framework.

API data breach

“T-Mobile Says Hack Exposed Personal Data of 40 Million People” (18/08/2021)

A misconfigured API allowed hackers to access personal data, Social Security numbers and driver’s licence information, costing the company huge compensation costs.

“Optus: 10 million current and former customers comprising a third of Australia’s population” (20/09/2022)

The API data breach occurred through an unprotected and publicly exposed API.

API/GraphQL Security

API: Security (megatask)

Penetration testing will assess the OWASP API Security risks:

  • Broken Object Level Authorization
  • Broken User Authentication
  • Excessive Data Exposure
  • Lack of Resources & Rate Limiting
  • Broken Function Level Authorization
  • Mass Assignment
  • Security Misconfiguration
  • Injection
  • Improper Assets Management
  • Insufficient Logging & Monitoring
A project board links API and GraphQL security tasks—including CORS and rate limiting—to a detailed OWASP API Security checklist.

Additional security features

  • Secure file upload: Enable antivirus
  • Prevent brute force attacks: enable CAPTCHA

CAPTCHA can be enabled on:

  • Public forms, e.g. contact forms
  • Login forms after a set number of failed attempts
  • Forgotten-password forms
Security tasks on a project board connect to a detailed CAPTCHA issue showing where the control should be enabled.

Production readiness

  • Development, testing and production environments are segregated.
  • Development and modification of software only takes place in development environments.

Application in production

  • Disable or restrict the super-admin user and development-only features.
  • Prevent code modification and log configuration changes.

Production environment

  • Restrict detailed errors and file-system access.
  • Use centralised logging and alerting.
  • Enable SSL/HTTPS and configure a CDN.
  • Monitor uptime, resources and traffic.
A production-checklist task points to a detailed checklist covering application lockdown, logging, transport security, CDN configuration, and monitoring.

Why Secure by Design?

  • Plan and build security features first
  • Better project estimation
  • Preparation for penetration testing
  • Security compliance
  • Enhance, expand and create your own secure-by-design project template
A long project-issue list demonstrates how security work can be planned as concrete tasks from the beginning of a project.

Secure Coding Practices

What are the best practices for front end?

Threat vectors

Cybersecurity threat vectors, or attack vectors, are methods or mechanisms cybercriminals use to gain illegal, unauthorized access to computer systems and networks.

For web applications:

  • Lack of encryption
  • Vulnerability exploits
  • Browser-based attacks

Easy fix with CDN!?

A browser screenshot shows a CDN security service blocking a request whose URL contains an encoded JavaScript XSS payload, raising the question of whether a CDN alone is a sufficient fix.

Browser-based attacks

Prevent attackers injecting malicious code into a website through:

  • Form data
  • Query strings
  • Cookies
  • HTTP headers
  • Local storage and client-side databases
  • Third-party API responses

Browser-based attacks

Prevent attackers injecting malicious code through feature-specific inputs:

  • Extracted and displayed image metadata
  • Malicious text recognized in images
  • User-provided links, including javascript: URLs instead of https://
  • Uploaded files containing viruses, malware or malicious scripts

Coding and security

To make code more secure:

  • Use frameworks and follow their best practices: React, Vue, Angular, Symfony, Laravel, and ASP.NET Core with Blazor.
  • Handle—and do not trust—user input.
  • Use parameterized SQL queries.
  • Encode output.
  • Prevent Cross-Site Request Forgery (CSRF) by following framework best practices.

Best practices

Do: use default data binding or safe properties

<div>{data}</div>
element.innerText = data;

Don’t: use unsafe HTML access

<form action={data}>
element.innerHTML = data;

Best practices

Do: use DOMPurify to sanitise data

import purify from "dompurify";
<div dangerouslySetInnerHTML={{__html: purify.sanitize(data)}} />

Don’t: use dangerouslySetInnerHTML unless absolutely necessary

<div dangerouslySetInnerHTML={{__html: data}} />

Best practices

Do: validate user-supplied URLs

function validateURL(url) {
  const parsed = new URL(url)
  return ['https:', 'http:'].includes(parsed.protocol)
}

<a href={validateURL(url) ? url : ''}>Click here!</a>

Don’t: trust user-supplied URLs

<a href={attackerSuppliedUrl}>Click here!</a>

Add eslint-plugin-security

Add ESLint security rules to eliminate other issues:

  • Do not allow any use of JavaScript’s eval().
  • Clean up console.log(), debugger, and similar development artifacts.
A production browser console is crowded with hundreds of issues and application data logs, illustrating the information and noise left behind when debug output is not removed.

Examples

Vulnerabilities in the wild

SQL injection

CVE-2024-50479 — Improper neutralization of special elements in an SQL command in WooCommerce Quote Calculator allows blind SQL injection.

$sql = "INSERT INTO $dbTable (...)
VALUES('" . implode("','", $row) . "')";
$result = $wpdb->get_results($sql);
The vulnerable PHP code reads rows from an uploaded CSV file, concatenates each row directly into an SQL statement, and executes it without parameterization.

Fixed: SQL injection

Instead of executing a query directly, use $wpdb->prepare(). Learn from reputable plugins or core.

$wpdb->query(
  $wpdb->prepare(
    "INSERT INTO {$wpdb->term_relationships} ..."
  )
);
A WooCommerce source-code example demonstrates wrapping an SQL statement with WordPress’s prepared-query API.

Broken Access Control

CVE-2025-48947: CDN caching of session cookies in the Next.js Auth0 SDK.

const session = await this.sessionStore.get(req.cookies);
if (!session) {
  return new NextResponse(null, { status: 401 });
}
return NextResponse.json(session?.user);
A source-code diff highlights the authenticated profile response that returned session-user data without explicitly preventing intermediary caching.

Fixed: Broken Access Control

CVE-2025-48947: In Auth0 Next.js SDK versions 4.0.1 to 4.6.0, session cookies set by auth0.middleware may be cached by CDNs because Cache-Control headers are missing.

res.headers.set(
  "Cache-Control",
  "private, no-cache, no-store, must-revalidate, max-age=0"
);
res.headers.set("Pragma", "no-cache");
res.headers.set("Expires", "0");
The fix adds explicit no-cache response headers for session data so a CDN does not store and serve authenticated content.

XSS Injection

CVE-2024-45406: Craft CMS stored XSS in breadcrumb-list and title fields. Multiple stored-XSS attacks can be triggered through fields containing user input.

return Html::encode($this->getUiLabel());
A source-code diff replaces direct output of a user-controlled UI label with HTML-encoded output, preventing the label from being interpreted as executable markup.

Extreme XSS

JSF*** XSS injection: alert(1)

A very long payload composed only of punctuation demonstrates JSF***, an obfuscated JavaScript encoding capable of producing and executing an XSS alert.

SVG with XSS

What will happen?

<?xml version="1.0" standalone="no"?>
<svg version="1.1" baseProfile="full"
  xmlns="http://www.w3.org/2000/svg">
  <script type="text/javascript">
    alert('XSS-Vulnerability-SVG');
  </script>
</svg>

Prototype pollution

CVE-2025-27597: Vue I18n prototype pollution in handleFlatJson.

lib.handleFlatJson({
  "__proto__.pollutedKey": "pollutedValue"
});
A proof of concept passes a specially constructed __proto__ property path into the library and then checks whether the shared object prototype acquired the attacker-controlled value.

Fixed: Prototype pollution

CVE-2025-27597: Vue I18n prototype pollution in handleFlatJson.

if (subKeys[i] === '__proto__') {
  throw new Error(`unsafe key: ${subKeys[i]}`)
}
The patch rejects the unsafe __proto__ path segment before creating or assigning nested object properties.

Practice!

  • Go to CVE.org or GitHub > Security.
  • Look up recent vulnerabilities and how they were fixed.
  • Check your code.

AI and security

Prompt

In WordPress, use a query-string parameter to set a cookie. Set a cookie named gfg_discount_code with the value of the gfg_discount_code parameter.

AI and security

Output of GitHub Copilot six months ago

setcookie(
  'gfg_discount_code',
  wp_unslash($_GET['gfg_discount_code']),
  time() + (10 * YEAR_IN_SECONDS),
  '/'
);
The generated PHP transfers an unslashed query-string value directly into a long-lived cookie without sanitizing it.

AI and security

Output of ChatGPT yesterday

function set_discount_cookie_from_query() {
  if (isset($_GET['gfg_discount_code'])) {
    $discount_value = sanitize_text_field($_GET['gfg_discount_code']);
    setcookie('gfg_discount_code', $discount_value, time() + (30 * DAY_IN_SECONDS));
    $_COOKIE['gfg_discount_code'] = $discount_value;
  }
}
add_action('init', 'set_discount_cookie_from_query');
The generated WordPress code improves on the earlier example by sanitizing the query parameter before storing it in a cookie.

AI and security

ChatGPT explanation

  • isset($_GET['gfg_discount_code']) checks whether the URL contains the parameter.
  • sanitize_text_field() ensures the value contains no HTML or JavaScript.
  • setcookie() creates a cookie lasting 30 days.
  • Assigning the value to $_COOKIE makes it immediately available in the current request.

AI and security

Google Gemini prompt

Are you sure sanitize_text_field is required?

Gemini answers that it is required because the URL parameter is untrusted user input and could contain an XSS payload. It says sanitize_text_field() removes potentially dangerous HTML and preserves a plain string for the cookie.

Beware of AI

Have you tried to “Boost your productivity with AI” in Google Chrome?

AI assistance: Turn on AI assistance in Settings to get help with styles, network requests, performance, and files.

A Chrome DevTools screenshot shows the AI assistance panel beneath the Elements inspector. The panel invites the developer to enable the experimental feature and warns that it will not always be correct.

Beware of AI

But have you read the disclaimer?

Things to consider

Any user query and data the inspected page can access via Web APIs, network requests, files, and performance traces are sent to Google to generate explanations. This data may be seen by human reviewers to improve this feature. Don’t use on pages with personal or sensitive information.

A Chrome DevTools settings screenshot highlights the privacy warning shown before AI assistance is enabled.

Action list: next week

  • Subscribe to security advisories
  • Skim through the publications:
    • CISA: Secure by Design tactics
    • ACSC: Guidelines for Software Development
    • OWASP Web Security Testing Guide
  • Run dependencies audit and plan updates

Action list: next three months

  • Scan your codebase for security issues
  • Brush up on secure coding standards and best practices
  • Schedule in-house security discussions:
    • Secure by Design projects for project managers
    • Regular knowledge sharing sessions for developers
  • Review existing projects based on Secure by Design tactics and tasks; identify security gaps

Action list: next six months

  • Dive deep into:
    • OWASP Cheat Sheets
    • OWASP Web Security Testing Guide
  • Start your next project as a Secure by Design project
  • Try one of the online security training systems or maybe start a formal qualification

Become a security champion!

Thank you!

Questions?

All resources are included in the Git repository:

A QR code provides access to the GitLab repository containing the presentation resources.

Technologies & Tools

  • ChatGPT
  • Craft CMS
  • dangerouslySetInnerHTML
  • DOMPurify
  • Gemini
  • Git
  • GitGuardian
  • GitHub
  • GitHub Copilot
  • GitLab
  • Google Chrome
  • GraphQL
  • Next.js
  • npm
  • React
  • securityheaders.com
  • Snyk
  • Vue
  • vue-i18n
  • WordPress

Standards & Specs

  • Content Security Policy
  • CVE
  • Permissions Policy
  • security.txt

Concepts & Methods

  • Broken access control
  • Cross-Site Request Forgery
  • Penetration testing
  • Prototype pollution
  • Secure by Design
  • SQL injection
  • Static Analysis Security Testing
  • XSS
  • Zero-day vulnerability

Organisations & Products

  • Australian Cyber Security Centre
  • CISA
  • Facebook
  • Google
  • HackerOne
  • OWASP
  • Stripe

Works

  • OWASP API Security
  • OWASP Top 10