Play this Trading Card Game to improve your App's security
Tags: security, devops, opensource
Published: 2022-02-04 14:58:27

On the one hand, I'm a gamer. I enjoy trading card games (TCG) like Dixit, Hearthstone, and Magic: The Gathering, and believe they are deeply immersive gateways to imaginary worlds that you explore with friends. They center around exploration, creativity, and play, and feel like the opposite of work. What's not to love?

On the other hand, I'm an infrastructure developer. I read and write code while asking questions like "is this reliable?", "is this fast?", and "is this safe?" These are serious questions that are often hard to solve. Never had I thought I'd be able to combine my love for TCGs with a topic as weighty as app security. And yet it's possible.

You may know the [OWASP Foundation](OWASP Foundation) from its annual [Top 10 Web App Security Risks](https://owasp.org/www-project-top-ten/) articles. If you don't, OWASP is an important authority in the field of web app security. They have plenty of free resources to improve your app's security, including, it turns out, a trading card game: [OWASP Cornucopia](https://owasp.org/www-project-cornucopia/).

In this blog post, I'll explore how to play Cornucopia and how the game can help improve the security of your app. Let's go.

## How to Play Cornucopia

### Setting Up the Game

First, you need to pick the language you're most comfortable playing in, print out one of the respective documents below, and cut out the individual cards.

- DOCX: [EN](https://github.com/OWASP/www-project-cornucopia/tree/master/assets/files/ecommerce/EN), [ES](https://github.com/OWASP/www-project-cornucopia/tree/master/assets/files/ecommerce/ES), [FR](https://github.com/grandtom/OWASP-Cornucopia-Translate-Cards---FR), [PT-BR](https://github.com/wagnerfusca/OWASP-Cornucopia-Translate-Cards---PT)
- PDF: [EN](https://owasp.org/www-project-cornucopia/assets/files/Owasp-cornucopia-ecommerce_website-EN.pdf)

_Cornucopia is under the Creative Commons Attribution License, so you're entirely free to download and translate the document in your language if you want to help with the project's internationalization._

Alternatively, you can buy Cornucopia cards at Amazon or other e-commerce websites. Sometimes, you can buy them from selling points at InfoSec conferences too.

Once you've printed and cut out the cards, create a scoresheet (either online or on a printed sheet of paper) with player names, the name of the application, and which part of your app you will be examining throughout the game.

![Scoreboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zd3ttonvb3gcioj73ori.png)

Let's imagine we're examining the basket functionality of a v1 pet shop e-commerce application we're working on. Ideally, you play this with the team you're building the app with. Cornucopia allows you to identify both genuine security threats to your app and gaps in your security knowledge, so you can prioritize your learning appropriately.

### Playing Your First Round

It's time to organize the deck. If it's your first time playing, remove the `Aces`, `Jokers`, and `Cornucopia` cards. These are difficult cards that you can reintroduce when you're more familiar with the game (we'll cover these cards in a future blog post). Also remove the cards not relevant to your app. For example, if your app is unauthenticated, remove all Authentication cards.

Next, take all the remaining cards and give them a good shuffle. Deal out six cards face down to each player. Then give everyone a few minutes to read their cards. Wait until everyone indicates they've read their cards. Next, choose who starts first. For the sake of explanation, imagine you're first. You have these cards:

![Q, 6, 2 from Authorization, J and 10 from Cryptography, and 7 from Session Management](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmgi0mis72aojgq8mipw.jpg)

Now you need to choose the highest-possible card that you think best describes a scenario that can threaten your app. Your job is to convince the other players that your app is vulnerable to this threat. If you succeed, you win a point. If you fail, you don't win a point.

Each player plays their card this way, trying to convince the team that the scenario on their card is a genuine security threat to the app. At the end of each round, a point is also given to the player who had the highest valid card (the higher the card, the more serious the security threat).

Let's clarify with an example. Imagine you play a Q from Authorization, which describes a scenario where Christopher can inject a command so the app will run at a higher privilege level. You argue that the pet shop app is vulnerable to this, because it runs in Java with an outdated Log4j.

![Q from Authorization](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iq62jqa8hglextpvilsq.jpg)

The other team members can't argue with your logic and you win a point. Unless a team member says that the Log4j is already updated and it no longer represents a threat, in which case you don't win a point. That's it, onto the next player until everyone has played their card, after which the highest valid card gets another point.

You keep playing rounds until all players have played their cards. The winner is the person with the most points, i.e. the player who played the most and/or the highest cards with genuine security threats.
On the right, close the player name, add a point.

If someone says that the Log4j is already updated and this is no longer a concern, the point will go to the second-highest card (if it is a valid threat).

Originally published at [X-Team Blog](https://ayr-ton.link/owasp-cornucopia) and reviewed by [Thomas De Moor](https://ayr-ton.link/thomas). Join [X-Team](https://ayr-ton.link/join-xteam)