Make sure we are blocking pushes with disallowed submodule url

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Summary

A customer reported issues with repository sync on their GEO secondary. One of their repo was failing sync with:

Error syncing repository: 13:creating repository: cloning repository: exit status 128, stderr: "error: object 26bbbb44bda118d7f100c252419a56331ae91619: gitmodulesUrl: disallowed submodule url: ../..//group/subgroup/project...

The error comes from 'git' source code, the expected relative path should not have another / or : after ../ or ./.

When performing push git client using ssh protocol, the push is regected with the same gitmodulesUrl: disallowed submodule url. However, I can successfully add the disallowed characters via a simple editor and WEB ide.

Steps to reproduce

  1. Create a project, add a submodule to it.
  2. In GitLab UI modify .gitmodules file and change the value of url key from ../../group/subgroup/project to ../..//group/subgroup/project.
  3. The file is saved successfully.

What is the current bug behavior?

Such file can be saved successfully in UI and Web ide while it is regected with git client.

What is the expected correct behavior?

The commit should be rejected when .gitmodules file when the url has another / or : after ../ or ./.

Output of checks

This bug happens on GitLab.com

Possible fixes

Edited Jun 21, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading