Repository navigation
Open
Labels
Milestone
Description
You can create groups with all sorts of names in the webUI or with the provisioning API like:
curl http://admin:admin@localhost:8080/ocs/v2.php/cloud/groups -X POST -d "groupid=q?mark"
curl http://admin:admin@localhost:8080/ocs/v2.php/cloud/groups -X POST -d "groupid=a%sign"
curl http://admin:admin@localhost:8080/ocs/v2.php/cloud/groups -X POST -d "groupid=a/slash"
and other special characters.
You can list all groups fine with:
curl http://admin:admin@localhost:8080/ocs/v2.php/cloud/groups
And view individual groups with:
curl http://admin:admin@localhost:8080/ocs/v2.php/cloud/groups/a%sign
and to get a "?" through, you have to put the escaped value "%3F"
curl http://admin:admin@localhost:8080/ocs/v2.php/cloud/groups/q%3Fmark
You can delete such groups with:
curl http://admin:admin@localhost:8080/ocs/v2.php/cloud/groups/a%sign -X DELETE
curl http://admin:admin@localhost:8080/ocs/v2.php/cloud/groups/q%3Fmark -X DELETE
The problem comes if you try with groups that have a / in their name. A literal slash is never going to work:
curl http://admin:admin@localhost:8080/ocs/v2.php/cloud/groups/a/slash
And an escaped slash, like this, is rejected by the server (Apache or PHP dev server):
curl http://admin:admin@localhost:8080/ocs/v2.php/cloud/groups/a%2Fslash
So you cannot manage a group like a/slash via the provisioning API. But you can manage it through webUI.
Activity
phil-davis commentedon Apr 5, 2018
This was noticed while merging code for webUI and API acceptance tests. The webUI tests have a scenario that creates a group called
a/slash- the API acceptance test steps could not delete the group.ownclouders commentedon Apr 5, 2018
GitMate.io thinks possibly related issues are #25465 (Сan not delete a group with a slash in the group name), #29990 (cannot add user to group called "0" by using provisioning API), #21249 (Deleting user with provisioning API can take a long time), #29698 (a group called "0" cannot be created by provisioning API), and #6435 (Cannot delete group).
phil-davis commentedon May 31, 2021
There are acceptance tests tagged
@issue-31015 @skipOnOcV10that do stuff with group names that contain a/The expected behavior and current actual behavior is covered by tests.
If someone thinks of a way to fix this, then remove the tags and adjust the code to make the tests pass...
Removing my assignment, because the tests are there.
stale commentedon Sep 20, 2021
This issue has been automatically closed.
phil-davis commentedon Sep 20, 2021
This is still a problem. "someone" needs to decide if groups are allowed to have a slash in their name. Then either we fix this somehow, or we prevent groups from having a slash in their name.
DeepDiver1975 commentedon Jun 19, 2026
🤖 Automated issue analysis by Claude Code review agent.
Classification: confirmed-bug (still present in current
master)Summary
Groups whose name contains a forward slash (
/) cannot be viewed, deleted, or otherwise managed through the OCS Provisioning API, even though they can be created and managed via the webUI. This was reported in 2018, re-confirmed by the reporter in 2021, and the behavior is still present in the current codebase.Evidence that it is still unfixed
The single-group routes use the group id as a URL path segment, so a literal
/in the name is interpreted as a path separator and an encoded%2Fis rejected by the web server before reaching the app:apps/provisioning_api/appinfo/routes.phpregisters:GET /cloud/groups/{groupid}→Groups::getGroupDELETE /cloud/groups/{groupid}→Groups::deleteGroupGET /cloud/groups/{groupid}/subadmins→Groups::getSubAdminsOfGroup{groupid}placeholder matches a single path segment, soa/slashsplits across segments and never reaches the handler intact.The application layer does nothing special with slashes —
apps/provisioning_api/lib/Groups.phpjust reads$parameters['groupid']directly (e.g. ingetGroup()anddeleteGroup()). The bug is therefore at the routing / web-server layer, not in the controller logic. Create (POST /cloud/groupswithgroupidin the body viaaddGroup()) works precisely because the name travels in the request body, not the URL path.No web-server-level mitigation is present — there is no
AllowEncodedSlashesdirective anywhere in the repo (searched repo-wide), so encoded%2Fis rejected by Apache/PHP-FPM defaults (HTTP 404/400) before the OCS router runs. This matches the original report ("an escaped slash ... is rejected by the server").Acceptance tests still document the broken behavior as of current
master— they remain tagged@issue-31015and assert the failing state, with comments saying to flip the assertions only "after fixing issue-31015":tests/acceptance/features/apiProvisioningGroups-v1/deleteGroupOc10Issue31015.featuretests/acceptance/features/apiProvisioningGroups-v2/deleteGroupOc10Issue31015.featuretests/acceptance/features/apiProvisioningGroups-v{1,2}/addGroupOc10Issue31015.featuretests/acceptance/features/apiProvisioningGroups-v{1,2}/removeFromGroupOc10Issue31015.featuretests/acceptance/features/apiProvisioningGroups-v{1,2}/getUserGroupsOc10Issue31015.feature@issue-31015 @skipOnOcV10scenarios scattered inaddGroup.feature,deleteGroup.feature,addToGroup.feature,removeFromGroup.feature,getUserGroups.feature.Proposed fix
This is a genuine design tension: the group id is part of the URL path, but group ids are allowed to contain
/. There are two viable directions; option B is the lower-risk, recommended one and matches the reporter's 2021 comment ("either we fix this somehow, or we prevent groups from having a slash in their name").Option A — Make slashes work in the path (larger, web-server-dependent)
{groupid}matches one path segment, and encoded%2Fis blocked at the web-server tier.AllowEncodedSlashes NoDecode(Apache) plusnginx/PHP-FPM equivalents, and decoding/normalizing the segment in the OCS routing layer. This is fragile across deployments and changes documented HTTP behavior, so it is not recommended as the primary fix.Option B — Forbid
/in group names at creation time (recommended)apps/provisioning_api/lib/Groups.php, methodaddGroup(). It currently validates only for empty names and leading/trailing whitespace:/(and, for consistency with the/subadminscollision noted inaddGroup.feature, validate the name does not break route matching):\OC\Group\Manager::createGroup(lib/private/Group/Manager.php) — adding validation there centralizes the rule for both UI and API.*Oc10Issue31015.featurefiles and the@issue-31015 @skipOnOcV10scenarios so that creating a group named e.g.a/slashorMgmt/Sydneyis now rejected (expect the 101 "Invalid group name" response) rather than silently created-then-unmanageable, remove the@issue-31015/@skipOnOcV10skip tags, and flip the "should not exist"/"change to has been created" comments accordingly. Add/adjust a unit test forGroups::addGroup()asserting a slash-containing name returns failure code 101.Caveat
This repository is in maintenance mode and the issue was auto-closed by the stale bot in 2021 then re-opened/re-confirmed by a maintainer. A fix is still technically valid, but Option B is a behavior change (rejecting previously-accepted names) and needs a product decision, which is exactly what the reporter requested in the last comment.
Read-only automated analysis. No repository changes were made.
phil-davis commentedon Jun 19, 2026
Correct analysis. It should be easy to prevent creation of group names containing a slash in the first place.
In an LDAP environment with group names coming from an LDAP backend, we won't have control over the names. But in that case we don't delete them anyway. The "/" will still cause problems for the API trying to access an endpoint like
ocs/v2.php/cloud/groups/a/slashbut I don't see what can realistically be done about that. Just document that group names containing a slash should not be used.DeepDiver1975 commentedon Jun 19, 2026
Option B
phil-davis commentedon Jun 19, 2026
Note: there is also an issue #34086 about problems with groups that have a vertical bar in their name "|".
Who does that in real life?!
While we are implementing a ban on
/then maybe consider other special characters like|and ban those.dj4oC commentedon Jul 9, 2026
Implementation prompt
Problem: Groups whose name contains a forward slash (e.g.
a/slash) can be created via the web UI but cannot be viewed, deleted, or managed through the OCS Provisioning API, because the single-group routes (apps/provisioning_api/appinfo/routes.php) use{groupid}as a URL path segment — a literal or encoded/in the name breaks routing before it reaches the controller. Maintainers have settled on Option B in-thread (@DeepDiver1975, @phil-davis): reject/in group names at creation time rather than attempting to make slashes work in the URL path (which would require fragile, deployment-dependent web-server configuration).Acceptance criteria:
addGroup()) is rejected with the existing "Invalid group name" response (OCS code 101), not silently accepted.@issue-31015,@skipOnOcV10) are updated: creation of a slash-containing group now expects rejection (101) instead of the current skip/expected-failure state, and the tags are removed.Files:
apps/provisioning_api/lib/Groups.php—addGroup(): add a check rejecting/in$groupIdalongside the existing empty/whitespace validation, returning the same\OC\OCS\Result(null, 101, 'Invalid group name').lib/private/Group/Manager.php—createGroup(): add the same slash restriction so the web UI is covered too, not just the API.tests/acceptance/features/apiProvisioningGroups-v1/addGroupOc10Issue31015.feature,apiProvisioningGroups-v2/addGroupOc10Issue31015.feature, and the@issue-31015 @skipOnOcV10scenarios inaddGroup.feature,deleteGroup.feature,addToGroup.feature,removeFromGroup.feature,getUserGroups.feature— update expectations to "creation rejected" and remove the skip tags.Groups::addGroup()asserting a slash-containing name returns OCS code 101.Constraints:
/only (per the agreed decision); a separate related report (groups of systemtags are separated by "|" #34086,|in group names) should be handled independently rather than folded in silently.🤖 Automated by Claude Code
Generated by Claude Code