SCW Icons
hero bg no divider
Blog

Les codeurs conquièrent l'infrastructure de sécurité en tant que série de codes - Business Logic

Matias Madou, Ph.D.
Published Jun 22, 2020
Last updated on Mar 08, 2026

Well, this is it (for now). We have reached the end of our Infrastructure as Code series. We hope you've had fun conquering security issues in Docker, Ansible, Kubernetes, Terraform, and CloudFormation. Before we sign off, though, we've got one more vulnerability for you to master: business logic bugs.

Think you're ready to test your skills now? Try the final gamified challenge:

If you're still unclear on a few things, keep reading:

The vulnerabilities we want to focus on today are business logic flaws. These can occur when coders fail to properly implement business logic rules which could leave their applications vulnerable to different kinds of attacks should a malicious user choose to exploit them. Depending on the purpose and functionality implemented within each application, a business logic flaw may allow privilege escalation, improper resource usage or any number of unintended business processes to be performed.

Unlike many vulnerabilities, incorrect implementation of business logic rules can be surprisingly subtle. They require special vigilance to ensure that they don't sneak into applications and code.

What are some examples of business logic flaws?

As an example of how easy it can be to induce business logic flaws, consider the following example from a Docker environment defined with a Docker Compose file. To prepare containers to perform functions, a developer might use a standard resource policy, defined in the Docker Compose file,  like the following example:

deploy:
 resources:
   limits:
     cpus: "0.5"
   reservations:
     cpus: "0.5"

While that looks fine on the surface, this resource policy for containers isn't properly limiting resource usage. An attacker could take advantage of the business logic flaw to implement a denial of service (DoS) attack.

To try and limit users from taking up too many resources, a developer might try to better define what each container can support. So the new code might include a placement constraint:

deploy:
 resources:
   limits:
     cpus: "0.5"
   reservations:
     cpus: "0.5"
   placement:
     constraints:
       - "node.labels.limit_cpu == 100M"
       - "node.labels.limit_memory == 0.5"

At first glance, this looks like it would resolve the business logic flaw. However, the new placement constraint does not affect the resource usage limit for the Docker container service. It's only used to select a node to schedule the container. In this case, a DoS attack is still possible. The attacker would need to compromise a Docker container first, but would be able to drain resources without limits after that.

As you can see, thinking about business logic flaws and programming to eliminate them can be a tricky endeavor.

Eliminating business logic flaws

With business logic flaws, the key is knowing that they exist. You need to be vigilant about keeping them out of your environment while new code is being written. Business rules and best practices should be clearly defined and checked at all phases of the application development process including design, implementation and testing.

For example, to prevent a business logic flaw from enabling a DoS attack like in the above example, a best practice is to limit the amount of resources that every Docker container you create can use. Specifically, the limits section must specify the number of CPUs and the amount of memory a Docker container can use. An example would be:

deploy:
 resources:
   limits:
     cpus: "0.5"
     memory: 100M
   reservations:
     cpus: "0.5"
     memory: 50M

Using code like the example above as a policy would remove a major business logic flaw from the environment and prevent DoS attacks. This would work even if an attacker compromised one of the Docker containers. In that case, the attacker would still not be able to use their foothold to deplete resources.

Threat modeling can be helpful by defining how different attacks take place and ensuring that business logic rules are used to prevent and restrict them. Testing based on compliance rules and known abuse cases could also be helpful in catching business logic flaws that slip through the cracks.

Business logic flaws are some of the most subtle vulnerabilities that can sneak into applications, but are no less dangerous than other more high-profile risks. Knowing how they can occur and using best practices can keep them out of your environment during application development, ensuring that they never reach a production environment where they can be abused by attackers who are very familiar with how to exploit them.

Check out the Secure Code Warrior blog pages for more insight about this vulnerability and how to protect your organization and customers from the ravages of other security flaws. You can also try a demo of this IaC challenge in the Secure Code Warrior training platform to keep all your cybersecurity skills honed and up-to-date.


Afficher la ressource
Afficher la ressource

Cette vulnérabilité peut survenir lorsque les codeurs ne parviennent pas à implémenter correctement les règles de logique métier, ce qui pourrait rendre leurs applications vulnérables à différents types d'attaques si un utilisateur malveillant choisissait de les exploiter.

Vous souhaitez en savoir plus ?

Matias Madou, Ph.D. est expert en sécurité, chercheur, directeur technique et cofondateur de Secure Code Warrior. Matias a obtenu son doctorat en sécurité des applications à l'université de Gand, en se concentrant sur les solutions d'analyse statique. Il a ensuite rejoint Fortify aux États-Unis, où il s'est rendu compte qu'il ne suffisait pas de détecter uniquement les problèmes de code sans aider les développeurs à écrire du code sécurisé. Cela l'a incité à développer des produits qui aident les développeurs, allègent le fardeau de la sécurité et dépassent les attentes des clients. Lorsqu'il n'est pas à son bureau au sein de Team Awesome, il aime être sur scène pour faire des présentations lors de conférences telles que RSA Conference, BlackHat et DefCon.

learn more

Secure Code Warrior est là pour aider votre organisation à sécuriser le code tout au long du cycle de développement logiciel et à créer une culture dans laquelle la cybersécurité est une priorité. Que vous soyez responsable de la sécurité des applications, développeur, responsable de la sécurité informatique ou toute autre personne impliquée dans la sécurité, nous pouvons aider votre organisation à réduire les risques associés à un code non sécurisé.

Réservez une démo
Partagez sur :
linkedin brandsSocialx logo
Auteur
Matias Madou, Ph.D.
Published Jun 22, 2020

Matias Madou, Ph.D. est expert en sécurité, chercheur, directeur technique et cofondateur de Secure Code Warrior. Matias a obtenu son doctorat en sécurité des applications à l'université de Gand, en se concentrant sur les solutions d'analyse statique. Il a ensuite rejoint Fortify aux États-Unis, où il s'est rendu compte qu'il ne suffisait pas de détecter uniquement les problèmes de code sans aider les développeurs à écrire du code sécurisé. Cela l'a incité à développer des produits qui aident les développeurs, allègent le fardeau de la sécurité et dépassent les attentes des clients. Lorsqu'il n'est pas à son bureau au sein de Team Awesome, il aime être sur scène pour faire des présentations lors de conférences telles que RSA Conference, BlackHat et DefCon.

Matias est un chercheur et développeur qui possède plus de 15 ans d'expérience pratique en matière de sécurité logicielle. Il a développé des solutions pour des entreprises telles que Fortify Software et sa propre société Sensei Security. Au cours de sa carrière, Matias a dirigé de nombreux projets de recherche sur la sécurité des applications qui ont abouti à des produits commerciaux et possède plus de 10 brevets à son actif. Lorsqu'il n'est pas à son bureau, Matias a enseigné des cours de formation avancée sur la sécurité des applications et prend régulièrement la parole lors de conférences mondiales telles que RSA Conference, Black Hat, DefCon, BSIMM, OWASP AppSec et BruCon.

Matias est titulaire d'un doctorat en génie informatique de l'université de Gand, où il a étudié la sécurité des applications par le biais de l'obfuscation de programmes pour masquer le fonctionnement interne d'une application.

Partagez sur :
linkedin brandsSocialx logo

Well, this is it (for now). We have reached the end of our Infrastructure as Code series. We hope you've had fun conquering security issues in Docker, Ansible, Kubernetes, Terraform, and CloudFormation. Before we sign off, though, we've got one more vulnerability for you to master: business logic bugs.

Think you're ready to test your skills now? Try the final gamified challenge:

If you're still unclear on a few things, keep reading:

The vulnerabilities we want to focus on today are business logic flaws. These can occur when coders fail to properly implement business logic rules which could leave their applications vulnerable to different kinds of attacks should a malicious user choose to exploit them. Depending on the purpose and functionality implemented within each application, a business logic flaw may allow privilege escalation, improper resource usage or any number of unintended business processes to be performed.

Unlike many vulnerabilities, incorrect implementation of business logic rules can be surprisingly subtle. They require special vigilance to ensure that they don't sneak into applications and code.

What are some examples of business logic flaws?

As an example of how easy it can be to induce business logic flaws, consider the following example from a Docker environment defined with a Docker Compose file. To prepare containers to perform functions, a developer might use a standard resource policy, defined in the Docker Compose file,  like the following example:

deploy:
 resources:
   limits:
     cpus: "0.5"
   reservations:
     cpus: "0.5"

While that looks fine on the surface, this resource policy for containers isn't properly limiting resource usage. An attacker could take advantage of the business logic flaw to implement a denial of service (DoS) attack.

To try and limit users from taking up too many resources, a developer might try to better define what each container can support. So the new code might include a placement constraint:

deploy:
 resources:
   limits:
     cpus: "0.5"
   reservations:
     cpus: "0.5"
   placement:
     constraints:
       - "node.labels.limit_cpu == 100M"
       - "node.labels.limit_memory == 0.5"

At first glance, this looks like it would resolve the business logic flaw. However, the new placement constraint does not affect the resource usage limit for the Docker container service. It's only used to select a node to schedule the container. In this case, a DoS attack is still possible. The attacker would need to compromise a Docker container first, but would be able to drain resources without limits after that.

As you can see, thinking about business logic flaws and programming to eliminate them can be a tricky endeavor.

Eliminating business logic flaws

With business logic flaws, the key is knowing that they exist. You need to be vigilant about keeping them out of your environment while new code is being written. Business rules and best practices should be clearly defined and checked at all phases of the application development process including design, implementation and testing.

For example, to prevent a business logic flaw from enabling a DoS attack like in the above example, a best practice is to limit the amount of resources that every Docker container you create can use. Specifically, the limits section must specify the number of CPUs and the amount of memory a Docker container can use. An example would be:

deploy:
 resources:
   limits:
     cpus: "0.5"
     memory: 100M
   reservations:
     cpus: "0.5"
     memory: 50M

Using code like the example above as a policy would remove a major business logic flaw from the environment and prevent DoS attacks. This would work even if an attacker compromised one of the Docker containers. In that case, the attacker would still not be able to use their foothold to deplete resources.

Threat modeling can be helpful by defining how different attacks take place and ensuring that business logic rules are used to prevent and restrict them. Testing based on compliance rules and known abuse cases could also be helpful in catching business logic flaws that slip through the cracks.

Business logic flaws are some of the most subtle vulnerabilities that can sneak into applications, but are no less dangerous than other more high-profile risks. Knowing how they can occur and using best practices can keep them out of your environment during application development, ensuring that they never reach a production environment where they can be abused by attackers who are very familiar with how to exploit them.

Check out the Secure Code Warrior blog pages for more insight about this vulnerability and how to protect your organization and customers from the ravages of other security flaws. You can also try a demo of this IaC challenge in the Secure Code Warrior training platform to keep all your cybersecurity skills honed and up-to-date.


Afficher la ressource
Afficher la ressource

Remplissez le formulaire ci-dessous pour télécharger le rapport

Nous aimerions avoir votre autorisation pour vous envoyer des informations sur nos produits et/ou sur des sujets liés au codage sécurisé. Nous traiterons toujours vos données personnelles avec le plus grand soin et ne les vendrons jamais à d'autres entreprises à des fins de marketing.

Soumettre
scw success icon
scw error icon
Pour soumettre le formulaire, veuillez activer les cookies « Analytics ». N'hésitez pas à les désactiver à nouveau une fois que vous aurez terminé.

Well, this is it (for now). We have reached the end of our Infrastructure as Code series. We hope you've had fun conquering security issues in Docker, Ansible, Kubernetes, Terraform, and CloudFormation. Before we sign off, though, we've got one more vulnerability for you to master: business logic bugs.

Think you're ready to test your skills now? Try the final gamified challenge:

If you're still unclear on a few things, keep reading:

The vulnerabilities we want to focus on today are business logic flaws. These can occur when coders fail to properly implement business logic rules which could leave their applications vulnerable to different kinds of attacks should a malicious user choose to exploit them. Depending on the purpose and functionality implemented within each application, a business logic flaw may allow privilege escalation, improper resource usage or any number of unintended business processes to be performed.

Unlike many vulnerabilities, incorrect implementation of business logic rules can be surprisingly subtle. They require special vigilance to ensure that they don't sneak into applications and code.

What are some examples of business logic flaws?

As an example of how easy it can be to induce business logic flaws, consider the following example from a Docker environment defined with a Docker Compose file. To prepare containers to perform functions, a developer might use a standard resource policy, defined in the Docker Compose file,  like the following example:

deploy:
 resources:
   limits:
     cpus: "0.5"
   reservations:
     cpus: "0.5"

While that looks fine on the surface, this resource policy for containers isn't properly limiting resource usage. An attacker could take advantage of the business logic flaw to implement a denial of service (DoS) attack.

To try and limit users from taking up too many resources, a developer might try to better define what each container can support. So the new code might include a placement constraint:

deploy:
 resources:
   limits:
     cpus: "0.5"
   reservations:
     cpus: "0.5"
   placement:
     constraints:
       - "node.labels.limit_cpu == 100M"
       - "node.labels.limit_memory == 0.5"

At first glance, this looks like it would resolve the business logic flaw. However, the new placement constraint does not affect the resource usage limit for the Docker container service. It's only used to select a node to schedule the container. In this case, a DoS attack is still possible. The attacker would need to compromise a Docker container first, but would be able to drain resources without limits after that.

As you can see, thinking about business logic flaws and programming to eliminate them can be a tricky endeavor.

Eliminating business logic flaws

With business logic flaws, the key is knowing that they exist. You need to be vigilant about keeping them out of your environment while new code is being written. Business rules and best practices should be clearly defined and checked at all phases of the application development process including design, implementation and testing.

For example, to prevent a business logic flaw from enabling a DoS attack like in the above example, a best practice is to limit the amount of resources that every Docker container you create can use. Specifically, the limits section must specify the number of CPUs and the amount of memory a Docker container can use. An example would be:

deploy:
 resources:
   limits:
     cpus: "0.5"
     memory: 100M
   reservations:
     cpus: "0.5"
     memory: 50M

Using code like the example above as a policy would remove a major business logic flaw from the environment and prevent DoS attacks. This would work even if an attacker compromised one of the Docker containers. In that case, the attacker would still not be able to use their foothold to deplete resources.

Threat modeling can be helpful by defining how different attacks take place and ensuring that business logic rules are used to prevent and restrict them. Testing based on compliance rules and known abuse cases could also be helpful in catching business logic flaws that slip through the cracks.

Business logic flaws are some of the most subtle vulnerabilities that can sneak into applications, but are no less dangerous than other more high-profile risks. Knowing how they can occur and using best practices can keep them out of your environment during application development, ensuring that they never reach a production environment where they can be abused by attackers who are very familiar with how to exploit them.

Check out the Secure Code Warrior blog pages for more insight about this vulnerability and how to protect your organization and customers from the ravages of other security flaws. You can also try a demo of this IaC challenge in the Secure Code Warrior training platform to keep all your cybersecurity skills honed and up-to-date.


Afficher le webinaire
Commencez
learn more

Cliquez sur le lien ci-dessous et téléchargez le PDF de cette ressource.

Secure Code Warrior est là pour aider votre organisation à sécuriser le code tout au long du cycle de développement logiciel et à créer une culture dans laquelle la cybersécurité est une priorité. Que vous soyez responsable de la sécurité des applications, développeur, responsable de la sécurité informatique ou toute autre personne impliquée dans la sécurité, nous pouvons aider votre organisation à réduire les risques associés à un code non sécurisé.

Afficher le rapportRéservez une démo
Télécharger le PDF
Afficher la ressource
Partagez sur :
linkedin brandsSocialx logo
Vous souhaitez en savoir plus ?

Partagez sur :
linkedin brandsSocialx logo
Auteur
Matias Madou, Ph.D.
Published Jun 22, 2020

Matias Madou, Ph.D. est expert en sécurité, chercheur, directeur technique et cofondateur de Secure Code Warrior. Matias a obtenu son doctorat en sécurité des applications à l'université de Gand, en se concentrant sur les solutions d'analyse statique. Il a ensuite rejoint Fortify aux États-Unis, où il s'est rendu compte qu'il ne suffisait pas de détecter uniquement les problèmes de code sans aider les développeurs à écrire du code sécurisé. Cela l'a incité à développer des produits qui aident les développeurs, allègent le fardeau de la sécurité et dépassent les attentes des clients. Lorsqu'il n'est pas à son bureau au sein de Team Awesome, il aime être sur scène pour faire des présentations lors de conférences telles que RSA Conference, BlackHat et DefCon.

Matias est un chercheur et développeur qui possède plus de 15 ans d'expérience pratique en matière de sécurité logicielle. Il a développé des solutions pour des entreprises telles que Fortify Software et sa propre société Sensei Security. Au cours de sa carrière, Matias a dirigé de nombreux projets de recherche sur la sécurité des applications qui ont abouti à des produits commerciaux et possède plus de 10 brevets à son actif. Lorsqu'il n'est pas à son bureau, Matias a enseigné des cours de formation avancée sur la sécurité des applications et prend régulièrement la parole lors de conférences mondiales telles que RSA Conference, Black Hat, DefCon, BSIMM, OWASP AppSec et BruCon.

Matias est titulaire d'un doctorat en génie informatique de l'université de Gand, où il a étudié la sécurité des applications par le biais de l'obfuscation de programmes pour masquer le fonctionnement interne d'une application.

Partagez sur :
linkedin brandsSocialx logo

Well, this is it (for now). We have reached the end of our Infrastructure as Code series. We hope you've had fun conquering security issues in Docker, Ansible, Kubernetes, Terraform, and CloudFormation. Before we sign off, though, we've got one more vulnerability for you to master: business logic bugs.

Think you're ready to test your skills now? Try the final gamified challenge:

If you're still unclear on a few things, keep reading:

The vulnerabilities we want to focus on today are business logic flaws. These can occur when coders fail to properly implement business logic rules which could leave their applications vulnerable to different kinds of attacks should a malicious user choose to exploit them. Depending on the purpose and functionality implemented within each application, a business logic flaw may allow privilege escalation, improper resource usage or any number of unintended business processes to be performed.

Unlike many vulnerabilities, incorrect implementation of business logic rules can be surprisingly subtle. They require special vigilance to ensure that they don't sneak into applications and code.

What are some examples of business logic flaws?

As an example of how easy it can be to induce business logic flaws, consider the following example from a Docker environment defined with a Docker Compose file. To prepare containers to perform functions, a developer might use a standard resource policy, defined in the Docker Compose file,  like the following example:

deploy:
 resources:
   limits:
     cpus: "0.5"
   reservations:
     cpus: "0.5"

While that looks fine on the surface, this resource policy for containers isn't properly limiting resource usage. An attacker could take advantage of the business logic flaw to implement a denial of service (DoS) attack.

To try and limit users from taking up too many resources, a developer might try to better define what each container can support. So the new code might include a placement constraint:

deploy:
 resources:
   limits:
     cpus: "0.5"
   reservations:
     cpus: "0.5"
   placement:
     constraints:
       - "node.labels.limit_cpu == 100M"
       - "node.labels.limit_memory == 0.5"

At first glance, this looks like it would resolve the business logic flaw. However, the new placement constraint does not affect the resource usage limit for the Docker container service. It's only used to select a node to schedule the container. In this case, a DoS attack is still possible. The attacker would need to compromise a Docker container first, but would be able to drain resources without limits after that.

As you can see, thinking about business logic flaws and programming to eliminate them can be a tricky endeavor.

Eliminating business logic flaws

With business logic flaws, the key is knowing that they exist. You need to be vigilant about keeping them out of your environment while new code is being written. Business rules and best practices should be clearly defined and checked at all phases of the application development process including design, implementation and testing.

For example, to prevent a business logic flaw from enabling a DoS attack like in the above example, a best practice is to limit the amount of resources that every Docker container you create can use. Specifically, the limits section must specify the number of CPUs and the amount of memory a Docker container can use. An example would be:

deploy:
 resources:
   limits:
     cpus: "0.5"
     memory: 100M
   reservations:
     cpus: "0.5"
     memory: 50M

Using code like the example above as a policy would remove a major business logic flaw from the environment and prevent DoS attacks. This would work even if an attacker compromised one of the Docker containers. In that case, the attacker would still not be able to use their foothold to deplete resources.

Threat modeling can be helpful by defining how different attacks take place and ensuring that business logic rules are used to prevent and restrict them. Testing based on compliance rules and known abuse cases could also be helpful in catching business logic flaws that slip through the cracks.

Business logic flaws are some of the most subtle vulnerabilities that can sneak into applications, but are no less dangerous than other more high-profile risks. Knowing how they can occur and using best practices can keep them out of your environment during application development, ensuring that they never reach a production environment where they can be abused by attackers who are very familiar with how to exploit them.

Check out the Secure Code Warrior blog pages for more insight about this vulnerability and how to protect your organization and customers from the ravages of other security flaws. You can also try a demo of this IaC challenge in the Secure Code Warrior training platform to keep all your cybersecurity skills honed and up-to-date.


Table des matières

Télécharger le PDF
Afficher la ressource
Vous souhaitez en savoir plus ?

Matias Madou, Ph.D. est expert en sécurité, chercheur, directeur technique et cofondateur de Secure Code Warrior. Matias a obtenu son doctorat en sécurité des applications à l'université de Gand, en se concentrant sur les solutions d'analyse statique. Il a ensuite rejoint Fortify aux États-Unis, où il s'est rendu compte qu'il ne suffisait pas de détecter uniquement les problèmes de code sans aider les développeurs à écrire du code sécurisé. Cela l'a incité à développer des produits qui aident les développeurs, allègent le fardeau de la sécurité et dépassent les attentes des clients. Lorsqu'il n'est pas à son bureau au sein de Team Awesome, il aime être sur scène pour faire des présentations lors de conférences telles que RSA Conference, BlackHat et DefCon.

learn more

Secure Code Warrior est là pour aider votre organisation à sécuriser le code tout au long du cycle de développement logiciel et à créer une culture dans laquelle la cybersécurité est une priorité. Que vous soyez responsable de la sécurité des applications, développeur, responsable de la sécurité informatique ou toute autre personne impliquée dans la sécurité, nous pouvons aider votre organisation à réduire les risques associés à un code non sécurisé.

Réservez une démoTélécharger
Partagez sur :
linkedin brandsSocialx logo
Centre de ressources

Ressources pour vous aider à démarrer

Plus de posts
Centre de ressources

Ressources pour vous aider à démarrer

Plus de posts