> For the complete documentation index, see [llms.txt](https://hacking-notes.jord4n.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hacking-notes.jord4n.pro/fr/web/business-logic/insufficient-workflow-validation.md).

# Validation du flux de travail insuffisante

### Validation insuffisante du flux de travail

**Description du laboratoire**

Ce laboratoire repose sur des hypothèses incorrectes concernant la séquence logique des étapes du processus d'achat. L'application ne vérifie pas correctement que toutes les conditions nécessaires (y compris le paiement effectif) ont été remplies avant de valider une commande.

\*\* Objectif :\*\*/ Utilisez cette faille pour acheter le produit \*\*

**Identifiants fournis :**

* Utilisateur : `wiener`
* Mot de passe : `peter`

**Analyse du comportement de l'application**

* Lorsqu'un utilisateur tente de payer un article sans crédit suffisant, l'application renvoie l'erreur suivante :

  ```bash
  ?err=INSUFFICIENT_FUNDS
  Crédit boutique insuffisant pour cet achat
  ```

<figure><img src="/files/c8748330f9dc87424b87b77788ccd51dd4589fc1" alt=""><figcaption></figcaption></figure>

Cependant, la confirmation de commande repose uniquement sur l'accès à l'URL suivante :

```bash
/cart/order-confirmation?order-confirmed=true
```

* Cette page ne vérifie pas si le paiement a réellement été effectué ni si le solde était suffisant.

<figure><img src="/files/ddcb02dffca63a5dbcec4081521a2f52efe105d6" alt=""><figcaption></figcaption></figure>

**Fonctionnement de la faille**

1. Ajoutez au panier un article dont le prix est de **1337 €** (par exemple, la veste ciblée).

<figure><img src="/files/9fa22763015dbb587efcf804317bcd2d4169f1f7" alt=""><figcaption></figcaption></figure>

Ne finalisez pas le paiement normalement (celui-ci échoue faute de crédit).

Accédez directement, via une **GET** requête, à l'URL suivante :

`/cart/order-confirmation?order-confirmed=true`

* L'application valide alors la commande sans effectuer de contrôle supplémentaire.

<figure><img src="/files/add988850c1323c143594a229dec541f5070618d" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://hacking-notes.jord4n.pro/fr/web/business-logic/insufficient-workflow-validation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
