> 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/inconsistent-management-of-exceptional-entries.md).

# Gestion incohérente des entrées exceptionnelles

Notes sur la gestion incohérente des entrées exceptionnelles pour les laboratoires de la PortSwigger Web Security Academy, incluant le workflow d’exploitation, les tests de payloads, la validation dans Burp Suite et le contexte de remédiation.

### Traitement incohérent des entrées exceptionnelles

**Description du laboratoire**

Ce laboratoire montre une mauvaise validation des saisies utilisateur dans le processus d'inscription. Cette faille logique permet d'accéder à des fonctionnalités d'administration normalement réservées aux employés. / Objectif : accéder au panneau d'administration et supprimer l'utilisateur **carlos**.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-e4a529e2bc653e3fe5ba0cccc3d7114956f7b102%2F%7BF003D286-BE02-4F2A-A816-581F8D5EEF6F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Observation initiale**

Lors de l'inscription, un e-mail de validation est envoyé à l'adresse fournie. / Le serveur d'exploitation reçoit \*\*tous les e-mails\*\* associés au domaine et à ses sous-domaines :

```bash
@exploit-0a8c00a504628ac58246f51601c6009c.exploit-server.net
```

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-d8344705c03e2f692e4bd0c5a87cb3460647bd02%2F%7B063204D9-9DAA-44FD-87D3-B28E73186EE9%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Ainsi, toute adresse créée avec ce domaine ou ses sous-domaines est admissible.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-829269752bb8c018da9d2f097e055255937c3a54%2F%7B73C4204C-B05E-4969-9F0E-374462F4F4DE%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Comportement anormal identifié**

En créant une adresse e-mail contenant un très grand nombre de caractères avant le `@` symbole, nous constatons que le champ \*\*

{% code overflow="wrap" %}

```bash
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@exploit-0a8c00a504628ac58246f51601c6009c.exploit-server.net
```

{% endcode %}

Cette limite entraîne une incohérence entre la valeur réellement stockée et celle affichée ou utilisée pour les contrôles de sécurité.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-6458d90e182103302637ff5b65065df70258bb69%2F%7BDE810C79-066D-481B-A041-FDD7561AE051%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

**Fonctionnement de la faille**

L'objectif est de provoquer une troncature afin que l'e-mail enregistré se termine exactement par le `dontwannacry.com` zone de confiance.

Vérification de la longueur :

{% code overflow="wrap" %}

```bash
eecho -n "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@dontwannacry.com" | wc -c
```

{% endcode %}

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ba30042f34b216d452854ad38593a28b71fc2bee%2F%7B74ECAC2C-F3D0-4129-A380-21927E7EFF8B%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Une fois les 255 caractères atteints, l'adresse finale est construite de cette manière :

{% code overflow="wrap" %}

```bash
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@dontwannacry.com.exploit-0a8c00a504628ac58246f51601c6009c.exploit-server.net
```

{% endcode %}

Le serveur d'exploitation reçoit correctement l'e-mail, car il accepte tous les sous-domaines.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-ace3340e0a7a6742be84850375e76f11e62f9a95%2F%7B5754FFC3-BB9A-493B-93FC-4DCE114D9A0F%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

L'application, après troncature, interprète l'adresse comme appartenant à la `dontwannacry.com` domaine.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-9f8f0b0cd19e23b39fd8836377ce8dd0f6208deb%2F%7B93850A5C-CF01-4546-B764-B99452FC0F3B%7D.png?alt=media" alt=""><figcaption></figcaption></figure>

Le compte est considéré comme interne ou digne de confiance. / Une fois connecté, l'accès au **Panneau d'administration** est autorisé sans contrôle supplémentaire.

<figure><img src="https://3840167291-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fl4EVJpcOrsgjSGsLI7p2%2Fuploads%2Fgit-blob-7970720e563c151a759f90b50cd4deac274c5ebd%2F%7BC6B8D516-BD7F-4F2B-9990-8657AE424C98%7D.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://hacking-notes.jord4n.pro/fr/web/business-logic/inconsistent-management-of-exceptional-entries.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
