X Tutup
Skip to content

Commit fd04947

Browse files
committed
check public link already authenticated before checking password of link
1 parent 1df4764 commit fd04947

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

apps/dav/lib/Connector/PublicAuth.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ protected function validateUserPass($username, $password) {
9595
// check if the share is password protected
9696
if ($share->getPassword() !== null) {
9797
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK) {
98-
if ($this->shareManager->checkPassword($share, $password)) {
99-
return true;
100-
} elseif ($this->session->exists('public_link_authenticated')
98+
if ($this->session->exists('public_link_authenticated')
10199
&& $this->session->get('public_link_authenticated') === (string)$share->getId()) {
102100
return true;
101+
} elseif ($this->shareManager->checkPassword($share, $password)) {
102+
return true;
103103
} else {
104104
if (\in_array('XMLHttpRequest', \explode(',', $this->request->getHeader('X-Requested-With')))) {
105105
// do not re-authenticate over ajax, use dummy auth name to prevent browser popup

changelog/unreleased/38016

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Bugfix: Do not emit wrong "share.failedpasswordcheck" events for already authenticated links
2+
3+
ShareManager was checking password of already authenticated public links.
4+
This situation has been led to wrong "share.failedpasswordcheck" events emitting in already authenticated links.
5+
This problem has been resolved by first checking link already authenticated.
6+
7+
https://github.com/owncloud/brute_force_protection/issues/138
8+
https://github.com/owncloud/core/pull/38016

0 commit comments

Comments
 (0)
X Tutup