# Syfe

<figure><img src="https://2827710683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV9yg1NBoB0HDHj681gSk%2Fuploads%2Fd59auAqX3HZBrPIJp5IE%2Fimagen.png?alt=media&#x26;token=9c32cca0-89d4-45ad-be09-f7aeabc31911" alt=""><figcaption><p>Pa, me importa un qlo que sea informativo, igual es crecimiento pa mi si sabe. </p></figcaption></figure>

### Summary: <a href="#user-content-summary" id="user-content-summary"></a>

An Insecure Direct Object Reference (IDOR) vulnerability was discovered in Syfe’s promo code system, allowing unauthorized access to valid referral codes and exposing invitee names. This flaw could be exploited to fraudulently redeem promo codes, leading to financial losses, and reputational damage. Additionally, a deeper issue was identified in the referral system, which exposes a hierarchical structure of users by iterating over `referrerAppliedCode`, potentially leading to mass user data exposure.

### Technical Details: <a href="#user-content-technical-details" id="user-content-technical-details"></a>

1. The invite system uses API endpoints like:

```http
GET /promo/referral/SRPTUW33H HTTP/2
Host: api.syfe.com
```

* The server responds with a 200 OK, revealing valid promo code details.
* The referrerAppliedCode field remains null, indicating unused promo codes that could be exploited.

#### **Burp Repeater - API Syfer:**

<figure><img src="https://2827710683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV9yg1NBoB0HDHj681gSk%2Fuploads%2FfSAfiOLj6r7NSJS0Xnbt%2Fimagen.png?alt=media&#x26;token=e2cb154c-fed5-4806-b763-079e04948eb7" alt=""><figcaption></figcaption></figure>

#### **Syfer API Browser:**

<figure><img src="https://2827710683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV9yg1NBoB0HDHj681gSk%2Fuploads%2FM0XdOQgmRLehtHKuzTtZ%2Fimagen.png?alt=media&#x26;token=956ac764-4288-4757-bc90-0c2d6f6c70df" alt=""><figcaption></figcaption></figure>

2. The promo codes are also accessible via:

```http
https://www.syfe.com/invite?PROMO=SRPTUW33H
```

* This endpoint exposes the referrer’s name (e.g., **Sze Wei**), leading to potential privacy violations.

<figure><img src="https://2827710683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV9yg1NBoB0HDHj681gSk%2Fuploads%2FvfOK4znUzstUN3NFuJFQ%2Fimagen.png?alt=media&#x26;token=5d1930ff-62db-4880-809d-6066c0731413" alt=""><figcaption></figcaption></figure>

3. Categorization of Promo Codes Based on Referral Status:

* Codes Without a Referrer (referrerAppliedCode: NULL):
  * SRP16LW72, SRPQ9XPUD, SRPS4H3NH, SRPVW9182, SRPRRBGSF, SRPRYKNMN, SRPSURFGP, SRPSSMRCG, SRPSSMNGY, SRPSXQDTY, SRPT2KZFA, SRP6X8B8Y, SRPTEBYFA, SRPTGPUD2, SRPTNFL5D, SRPTUW33H, sgsmi, NOMONEYLAH
* Codes with an Existing Referrer (referrerAppliedCode: \<code>):
  * SRP6G4YN8, SRPRDR9KS, SRPS4P5YC, SRPSL8MGX, SRPT54W4C, SRPTXDRBM, SRPSTTW7Y, SRPTJDXHM, SRPTH8LK3

4. Mapping User Referral Hierarchy:

* By leveraging the `referrerAppliedCode` value in a request, it is possible to retrieve another user’s `referrerId` and `firstName`.
* By following the `referrerAppliedCode` chain, it is possible to reconstruct a tree-like structure of referrals.

#### Example of **exploitation**: <a href="#user-content-example-of-exploitation" id="user-content-example-of-exploitation"></a>

1. Requesting `/promo/referral/SRPTXDRBM` returns:

```json
{ "firstName": "Heng", "referrerId": 592559147, "referrerAppliedCode": "SRPSTTW7Y" }
```

<figure><img src="https://2827710683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV9yg1NBoB0HDHj681gSk%2Fuploads%2F9Z1wWm29LI5kfvKUsDgQ%2Fimagen.png?alt=media&#x26;token=5f0309ba-18f6-4b11-a394-c925df02c477" alt=""><figcaption></figcaption></figure>

2. Using `SRPSTTW7Y` in a new request reveals another user:

```json
{ "firstName": "VICTOR", "referrerId": 555275190, "referrerAppliedCode": "SRP6X8B8Y" }
```

<figure><img src="https://2827710683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV9yg1NBoB0HDHj681gSk%2Fuploads%2FLrDX2RXrNF2qofH1ADKv%2Fimagen.png?alt=media&#x26;token=0b6f975d-fcef-4218-a602-ef5602fa829e" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2827710683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV9yg1NBoB0HDHj681gSk%2Fuploads%2F5kRVAzzeBleoIFLJSvnQ%2Fimagen.png?alt=media&#x26;token=0753297c-73f3-41a0-a09d-6eecba2b23f8" alt=""><figcaption></figcaption></figure>

1.
   * Continuing this process (with the others PROMOCodes that i've found) reveals a full referral tree, potentially exposing thousands of user identities.
2. **Entropy analysis** of referral codes identified a predictable pattern in their structure, making enumeration feasible.
3. Attempting to redeem a retrieved promo code results in: _"Promo code is currently under review. You will receive the benefits if you meet all the terms and conditions of the promos."_
   * This suggests attackers could create fake accounts to exploit promotional bonuses.

### Steps To Reproduce: <a href="#user-content-steps-to-reproduce" id="user-content-steps-to-reproduce"></a>

For this case I will leave you a super fast video as a proof of concept explaining the step by step from burp and the step by step easy:

1. open URL: [https://api.syfe.com/promo/referral/](https://api.syfe.com/promo/referral/)\<code> and replace with the PromoCodes of this report in section `3. Categorization of Promo Codes Based on Referral Status`

<figure><img src="https://2827710683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV9yg1NBoB0HDHj681gSk%2Fuploads%2FULwCNyRJxu4bwzwDVyma%2Fimagen.png?alt=media&#x26;token=51c48e0e-2483-420a-b9f7-bffa9b126e7e" alt=""><figcaption></figcaption></figure>

2. Open URL Syfe Main Website: [https://www.syfe.com/invite?PROMO=](https://www.syfe.com/invite?PROMO=)\<code>

<figure><img src="https://2827710683-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV9yg1NBoB0HDHj681gSk%2Fuploads%2FAXRi5xyolBJRAeUbCRSS%2Fimagen.png?alt=media&#x26;token=d3b2c71e-7a1a-4bfe-bda1-2e12b6325141" alt=""><figcaption></figcaption></figure>

3. that's all

***

### Impact <a href="#user-content-impact" id="user-content-impact"></a>

1. **Financial Fraud:** Attackers can mass-harvest promo codes, create fake accounts, and exploit referral rewards, causing significant financial losses.
2. **User Data Exposure:** Real names and referral relationships are publicly accessible, leading to privacy breaches and phishing risks.
3. **Reputation Damage:** Public exposure of invitee data erodes user trust, potentially harming the company’s credibility and compliance standing.
4. **Hierarchical Exposure:** Attackers can map user referral chains, enabling targeted scams and account takeovers.

### Recommendation: <a href="#user-content-recommendation" id="user-content-recommendation"></a>

* Remove `referrerId` and `referrerAppliedCode` from public responses.
* Restrict access to promo codes, requiring authentication.
* Increase entropy in promo code generation to prevent easy enumeration.
* Enforce additional validation before applying promo codes.
* Monitor exploitation attempts through logging and rate limiting.

### Conclusion: <a href="#user-content-conclusion" id="user-content-conclusion"></a>

This IDOR vulnerability exposes promo codes and user invite details, allowing unauthorized use and potential fraud. The ability to traverse the referral hierarchy further exacerbates the risk, exposing user relationships and identifiers. Mitigating this issue will prevent abuse and reinforce user trust in Syfe’s security framework.

Thank you,&#x20;

Juan Felipe - _Security Researcher_
