# Broken Authentication

<figure><img src="https://114954437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfoyclHsS3E0AkBuajmOV%2Fuploads%2FdvT876eTNy18HdsQf1qX%2Fimage.png?alt=media&#x26;token=111266c2-7e5a-4d5e-9dd0-66491d240f2b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://114954437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfoyclHsS3E0AkBuajmOV%2Fuploads%2FODUsHihLUn4HI3D9gGWP%2Fimage.png?alt=media&#x26;token=8ecfe810-bdf1-4ea5-abde-a69a26cf2982" alt=""><figcaption></figcaption></figure>

## _<mark style="color:orange;">what is:</mark>_

* this is about weak or non-existent authentication to endpoints
* in the real-world breaches , it's very common
* The exposure is the ability to access other users’ accounts, data theft, unauthorized transactions.

***

## <mark style="color:orange;">Example:</mark>

* weak authentication are things like weak password requirements
* vulnerability to credential stuffing; brute forcing of IDs and passwords - which are quite readily available on the dark web
* lack of CAPTCHAs or rate limiting
* lack of lockouts on accounts
* putting authentication info into URLs - which can be sniffed and reused by malicious parties
* changing passwords without authentication or verification
* not validating tokens
* not storing passwords properly

***

## _<mark style="color:orange;">Prevention:</mark>_

* إذا كان لديك an endpoint تؤدي وظائف حميدة إلى حد ما، فربما يكون no authentication أمرًا جيدًا تمامًا وإذا كان لديك an endpoint تصل إلى معلومات تعريف شخصية (PII)، فربما تريد التأكد من أنك تطبق very strict authentication
* تنفيذ application logic لضمان رؤية المستخدمين فقط لما يحق لهم رؤيته
* تريد تنفيذ continuous testing للتأكد من عدم تسلل أي تغييرات into code logic أو إلى البنية الأساسية التي قد تكشف عن new authentication vulnerabilities
