Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #6890

Closed
Open
Created Apr 28, 2014 by Administrator@rootOwner

500 error when adding a new project with a repository name starting with question mark.

Created by: bruffridge

The regex for validating repository names allows question marks and periods to start the name. I tried adding a new project with a repo name that starts with a question mark and got a 500 error on the POST request and on all subsequent GET requests to the server.

Looks like the bug was introduced here: https://github.com/gitlabhq/gitlabhq/commit/cc1f7ea2de68ba7d2f45a65e36549c63fb23508f

https://github.com/gitlabhq/gitlabhq/blob/master/lib/gitlab/regex.rb#L52 Offending regex: /\A[.?]?[a-zA-Z0-9_][a-zA-Z0-9_-.]*(?<!.git)\z/

It seems the regex was designed to allow filenames to start with a period ONLY, in which case the regex should be:

/\A[.]?[a-zA-Z0-9_][a-zA-Z0-9_-.]*(?<!.git)\z/

If repo names shouldn't be allowed to start with a period either than alter project.rb and reference a different regex instead of path_regex:

https://github.com/gitlabhq/gitlabhq/blob/master/app/models/project.rb#L96

Assignee
Assign to
Time tracking