diff --git a/apps/dav/lib/carddav/sharing/plugin.php b/apps/dav/lib/carddav/sharing/plugin.php
index edc1a5fc11784b2e753662a7a279f96f742ba8c7..eeb5abc6d23957da5b9f1c987f9d031b06cbce5c 100644
--- a/apps/dav/lib/carddav/sharing/plugin.php
+++ b/apps/dav/lib/carddav/sharing/plugin.php
@@ -2,6 +2,9 @@
 
 namespace OCA\DAV\CardDAV\Sharing;
 
+use OCA\DAV\Connector\Sabre\Auth;
+use OCP\IRequest;
+use Sabre\DAV\Exception\BadRequest;
 use Sabre\DAV\Exception\NotFound;
 use Sabre\DAV\Server;
 use Sabre\DAV\ServerPlugin;
@@ -11,6 +14,11 @@ use Sabre\HTTP\ResponseInterface;
 
 class Plugin extends ServerPlugin {
 
+	public function __construct(Auth $authBackEnd, IRequest $request) {
+		$this->auth = $authBackEnd;
+		$this->request = $request;
+	}
+
 	/**
 	 * Reference to SabreDAV server object.
 	 *
@@ -87,6 +95,9 @@ class Plugin extends ServerPlugin {
 			return;
 		}
 
+		// CSRF protection
+		$this->protectAgainstCSRF();
+
 		$requestBody = $request->getBodyAsString();
 
 		// If this request handler could not deal with this POST request, it
@@ -190,5 +201,18 @@ class Plugin extends ServerPlugin {
 
 	}
 
+	private function protectAgainstCSRF() {
+		$user = $this->auth->getCurrentUser();
+		if ($this->auth->isDavAuthenticated($user)) {
+			return true;
+		}
+
+		if ($this->request->passesCSRFCheck()) {
+			return true;
+		}
+
+		throw new BadRequest();
+	}
+
 
 }
diff --git a/apps/dav/lib/connector/sabre/auth.php b/apps/dav/lib/connector/sabre/auth.php
index 39a7df31b7f93d01c624874f5c0d9a387a68a229..0394bfd67728fd14bab02d0808970988603cf917 100644
--- a/apps/dav/lib/connector/sabre/auth.php
+++ b/apps/dav/lib/connector/sabre/auth.php
@@ -65,7 +65,7 @@ class Auth extends AbstractBasic {
 	 * @param string $username
 	 * @return bool
 	 */
-	protected function isDavAuthenticated($username) {
+	public function isDavAuthenticated($username) {
 		return !is_null($this->session->get(self::DAV_AUTHENTICATED)) &&
 		$this->session->get(self::DAV_AUTHENTICATED) === $username;
 	}
diff --git a/apps/dav/lib/server.php b/apps/dav/lib/server.php
index 229f33858d9454b51a842b5002a807fd17be81d0..44afcf23df684b86c6dc2223bd6a22efedc307ec 100644
--- a/apps/dav/lib/server.php
+++ b/apps/dav/lib/server.php
@@ -50,6 +50,7 @@ class Server {
 		$this->server->addPlugin(new \Sabre\CalDAV\SharingPlugin());
 		$this->server->addPlugin(new \Sabre\CalDAV\Subscriptions\Plugin());
 		$this->server->addPlugin(new \Sabre\CalDAV\Notifications\Plugin());
+		$this->server->addPlugin(new CardDAV\Sharing\Plugin($authBackend, \OC::$server->getRequest()));
 
 		// addressbook plugins
 		$this->server->addPlugin(new \Sabre\CardDAV\Plugin());