SharePoint / SharePoint/sp-dev-docs

"Illegal characters in path" when retrieving an items permissions by id which title contains double quotes

Open
#9,946 4 comments 0 reactions 1 assignee View on GitHub

@Amey-MSFT is already working on this.

Since May 29, 2025.

area:csom/rest/api Needs: Triage :mag: type:bug-confirmed
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

SharePoint REST API

Developer environment

Windows

What browser(s) / client(s) have you tested
  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)
Additional environment details
  • ApplicationInsights
  • Postman
Describe the bug / error

Permission retrieval calls for some items fails. For example _api/web/lists('9d25363f-ba2a-452d-99e0-6e1d9c004e17')/items(13995)/GetSharingInformation/permissionsInformation/principals failed, while others item IDs worked.

The response is a HTTP 400 with body

{
    "odata.error": {
        "code": "-2147024809, System.ArgumentException",
        "message": {
            "lang": "en-US",
            "value": "Illegal characters in path."
        }
    }
}

After some investigation I found out that it always happen, if the title of the target item contains double quotes - as soon as I change it to single one it works.

This API call must have worked in april 2024 because I had found items with double quotes in there which would have broke our processes in the past if the error happend there

Steps to reproduce
  1. Create a sharepoint list
  2. Create a item with title containing "
  3. Set custom item permissions (may not be required)
  4. Retrieve the items permissions via REST API:
    _api/web/lists('<LISTGUID>')/items(<ITEMID>)/GetSharingInformation/permissionsInformation/principals
Expected behavior

Response JSON containing items permissions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.