# New /add_contacts /remove_contacts quick commands susseptible to XSS from Customer Contact firstname/lastname fields

Stored XSS via unescaped contact first/last name rendered in the /add_contacts quick-action autocomplete popup, executing JS for any user who triggers it.

- Payout: $13,950
- Severity: high
- Program: GitLab
- Found by (vendor credit): cryptopone(https://hackerone.com/cryptopone)
- Found by: cryptopone
- Disclosed: 2022-11-16
- CVE: CVE-2022-1948
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1578400
- Library page: https://bugbountylibrary.com/r/h1%3A1578400
- Tags: area:web domain:web impact:ato kind:bounty platform:hackerone sev:high tech:ruby technique:recon vuln:xss

**Target:** GitLab Customer Relations quick actions (/add_contacts, /remove_contacts) autocomplete
**Root cause:** Contact firstname/lastname are inserted into the quick-action autocomplete HTML without escaping special characters, allowing script/iframe injection.
**Steps:**
1. Create a group and enable Customer Relations under Settings -> General -> Permissions and group features.
2. Create a contact with First name and Last name set to `<script>alert(document.domain)</script>`.
3. Create a project in that group and open a new Issue.
4. In the description type `/add_contacts` to open the autocomplete popup.
5. Press enter to load the contact list, triggering the XSS.
**How found:** Researcher noticed the new 15.0.0 Customer Relations quick-action feature renders contact names in a popup, hypothesized the names were not escaped, and tested with a script payload in first/last name fields.
**Exploitation:** Attacker with permission to create contacts stores the payload; any user who types /add_contacts or /remove_contacts in an issue description triggers execution in their session.
**Insight:** Newly shipped features (here a quick-action autocomplete) often render user-controlled fields into HTML without escaping; test every new autocomplete/dropdown that surfaces stored names.

## Proof of concept (copied exactly from the original report)

**XSS payload in contact first/last name**

```
Create a new contact with "First name" set to "`<script>alert(document.domain)</script>`" and "Last name" set to "`<script>alert(document.domain)</script>`". Provide an email address and save your changes.
```

**Trigger XSS via /add_contacts quick action**

```
In the description pane type "/add_contacts" so the popup appears, then press "enter" to trigger the XSS.
```

