Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,330
    • Merge requests 1,330
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #197302
Closed
Open
Issue created Jan 16, 2020 by Dan Jensen@djensenContributor

XSS vulnerability on custom project templates form

Summary

The "custom project templates" form is vulnerable to Cross Site Scripting (XSS) attack, as originally reported by @jbroullon in https://gitlab.com/gitlab-org/security/gitlab/merge_requests/50#note_271210097.

Steps to reproduce

  • Log in as an admin
  • Add a malicious script to a group name
    • Open any group
    • Select Settings > General in the left sidebar
    • Add this to the "Group name": <SCRIPT>alert('ATTACKED!')</SCRIPT>
    • Click to "Save changes"
  • Confirm the malicious script is executed on the "Custom project templates" page
    • Go to Settings > Custom project templates
    • Click the group search dropdown input to open it
    • See an alert appear with the text "ATTACKED!"

What is the current bug behavior?

User input is treated as trusted.

What is the expected correct behavior?

User input is not treated as trusted.

Relevant logs and/or screenshots

Similar to #30173 (closed) and #197301 (closed).

Output of checks

This bug happens on GitLab.com

Possible fixes

  • Escape using sanitizeItem()
  • Escape before saving to the database (but there is strange behavior with this)
Assignee
Assign to
Time tracking