Skip to content

Username isn't urldecoded in dav invitation response handling #21298

Description

@tcitworld

See the Nextcloud log below, there's a space in the username and the user name stays User%20name until the check in database, therefore isn't found.

Server configuration

Web server: nginx

Database: Postgresql

PHP version: 7.3

Nextcloud version: 18.0.4

Nextcloud log (data/nextcloud.log)

Nextcloud log
{
  "reqId": "iASZFriLHs5y3Gjft92F",
  "level": 3,
  "time": "2020-06-06T11:46:40+02:00",
  "remoteAddr": "176.169.34.85",
  "user": "User name",
  "app": "index",
  "method": "GET",
  "url": "/apps/dav/invitation/accept/QcLhWS7XUrAFrz2CPJWmBUhL51c8bdFMybFs1NMn38LNOxI0KV79EXX7lWXO",
  "message": {
    "Exception": "Sabre\\DAV\\Exception\\NotFound",
    "Message": "Principal with name User%20name not found",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 76,
        "function": "getChild",
        "class": "Sabre\\DAVACL\\AbstractPrincipalCollection",
        "type": "->",
        "args": [
          "User%20name"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php",
        "line": 71,
        "function": "getNodeForPath",
        "class": "Sabre\\DAV\\Tree",
        "type": "->",
        "args": [
          "calendars/User%20name"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAVACL/Plugin.php",
        "line": 621,
        "function": "getNodeForPath",
        "class": "Sabre\\DAV\\Tree",
        "type": "->",
        "args": [
          "calendars/User%20name/inbox"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAVACL/Plugin.php",
        "line": 196,
        "function": "getCurrentUserPrivilegeSet",
        "class": "Sabre\\DAVACL\\Plugin",
        "type": "->",
        "args": [
          "calendars/User%20name/inbox/"
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Connector/Sabre/DavAclPlugin.php",
        "line": 52,
        "function": "checkPrivileges",
        "class": "Sabre\\DAVACL\\Plugin",
        "type": "->",
        "args": [
          "calendars/User%20name/inbox/",
          [
            "{urn:ietf:params:xml:ns:caldav}schedule-deliver-reply"
          ],
          1,
          false
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/CalDAV/Schedule/Plugin.php",
        "line": 506,
        "function": "checkPrivileges",
        "class": "OCA\\DAV\\Connector\\Sabre\\DavAclPlugin",
        "type": "->",
        "args": [
          "calendars/User%20name/inbox/",
          "{urn:ietf:params:xml:ns:caldav}schedule-deliver-reply",
          1,
          false
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/CalDAV/Schedule/Plugin.php",
        "line": 138,
        "function": "scheduleLocalDelivery",
        "class": "Sabre\\CalDAV\\Schedule\\Plugin",
        "type": "->",
        "args": [
          {
            "uid": "812f101d-eb57-4885-9fe8-23e415a1d877",
            "component": "VEVENT",
            "method": "REPLY",
            "sequence": 2,
            "sender": "mailto:sender@email.com",
            "senderName": null,
            "recipient": "mailto:useremail@com",
            "recipientName": null,
            "scheduleStatus": null,
            "message": {
              "name": "VCALENDAR",
              "parent": null,
              "__class__": "Sabre\\VObject\\Component\\VCalendar"
            },
            "significantChange": true,
            "__class__": "Sabre\\VObject\\ITip\\Message"
          }
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/CalDAV/InvitationResponse/InvitationResponseServer.php",
        "line": 119,
        "function": "scheduleLocalDelivery",
        "class": "OCA\\DAV\\CalDAV\\Schedule\\Plugin",
        "type": "->",
        "args": [
          {
            "uid": "812f101d-eb57-4885-9fe8-23e415a1d877",
            "component": "VEVENT",
            "method": "REPLY",
            "sequence": 2,
            "sender": "mailto:sender@email.com",
            "senderName": null,
            "recipient": "mailto:useremail@com",
            "recipientName": null,
            "scheduleStatus": null,
            "message": {
              "name": "VCALENDAR",
              "parent": null,
              "__class__": "Sabre\\VObject\\Component\\VCalendar"
            },
            "significantChange": true,
            "__class__": "Sabre\\VObject\\ITip\\Message"
          }
        ]
      },
      {
        "file": "/var/www/nextcloud/apps/dav/lib/Controller/InvitationResponseController.php",
        "line": 86,
        "function": "handleITipMessage",
        "class": "OCA\\DAV\\CalDAV\\InvitationResponse\\InvitationResponseServer",
        "type": "->",
        "args": [
          {
            "uid": "812f101d-eb57-4885-9fe8-23e415a1d877",
            "component": "VEVENT",
            "method": "REPLY",
            "sequence": 2,
            "sender": "mailto:sender@email.com",
            "senderName": null,
            "recipient": "mailto:useremail@com",
            "recipientName": null,
            "scheduleStatus": null,
            "message": {
              "name": "VCALENDAR",
              "parent": null,
              "__class__": "Sabre\\VObject\\Component\\VCalendar"
            },
            "significantChange": true,
            "__class__": "Sabre\\VObject\\ITip\\Message"
          }
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 170,
        "function": "accept",
        "class": "OCA\\DAV\\Controller\\InvitationResponseController",
        "type": "->",
        "args": [
          "QcLhWS7XUrAFrz2CPJWmBUhL51c8bdFMybFs1NMn38LNOxI0KV79EXX7lWXO"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 99,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\DAV\\Controller\\InvitationResponseController"
          },
          "accept"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 125,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\DAV\\Controller\\InvitationResponseController"
          },
          "accept"
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php",
        "line": 47,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\DAV\\Controller\\InvitationResponseController",
          "accept",
          {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          },
          {
            "token": "QcLhWS7XUrAFrz2CPJWmBUhL51c8bdFMybFs1NMn38LNOxI0KV79EXX7lWXO",
            "_route": "dav.invitation_response.accept"
          }
        ]
      },
      {
        "function": "__invoke",
        "class": "OC\\AppFramework\\Routing\\RouteActionHandler",
        "type": "->",
        "args": [
          {
            "token": "QcLhWS7XUrAFrz2CPJWmBUhL51c8bdFMybFs1NMn38LNOxI0KV79EXX7lWXO",
            "_route": "dav.invitation_response.accept"
          }
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 299,
        "function": "call_user_func",
        "args": [
          {
            "__class__": "OC\\AppFramework\\Routing\\RouteActionHandler"
          },
          {
            "token": "QcLhWS7XUrAFrz2CPJWmBUhL51c8bdFMybFs1NMn38LNOxI0KV79EXX7lWXO",
            "_route": "dav.invitation_response.accept"
          }
        ]
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 1008,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/apps/dav/invitation/accept/QcLhWS7XUrAFrz2CPJWmBUhL51c8bdFMybFs1NMn38LNOxI0KV79EXX7lWXO"
        ]
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 38,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/var/www/nextcloud/3rdparty/sabre/dav/lib/DAVACL/AbstractPrincipalCollection.php",
    "Line": 118,
    "CustomMessage": "--"
  },
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:76.0) Gecko/20100101 Firefox/76.0",
  "version": "18.0.4.2"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions