Skip to content

Setting authorization header globally in basicauth.php is dangerous (fix for #141)#142

Merged
nerdmaennchen merged 1 commit intonextcloud:masterfrom
bjoernv:master
Apr 23, 2020
Merged

Setting authorization header globally in basicauth.php is dangerous (fix for #141)#142
nerdmaennchen merged 1 commit intonextcloud:masterfrom
bjoernv:master

Conversation

@bjoernv
Copy link
Copy Markdown
Contributor

@bjoernv bjoernv commented Apr 22, 2020

Fixes #141

Changes proposed in this pull request:

  • Authorization header for OC_User_BasicAuth is now set with locally stream context instead globally with stream_context_set_default function.
  • HTTP Redirects in OC_User_BasicAuth are disabled now, so authorization header can not be forwared to foreign servers.

* Authorization header for OC_User_BasicAuth is now set with locally stream context instead globally with stream_context_set_default function.
* HTTP Redirects in OC_User_BasicAuth are disabled now, so authorization header can not be forwared to foreign servers.
Closes nextcloud#141

Signed-off-by: Björn Voigt <bjoernv@arcor.de>
@bjoernv bjoernv changed the title Fix for #141 Setting authorization header globally in basicauth.php is dangerous (fix for #141) Apr 23, 2020
@nerdmaennchen
Copy link
Copy Markdown
Member

Hey there.

Thank you so much for bringing this up!
Indeed this is a serious flaw and your fix looks good.
I also agree that disabling follow_location is the better default behavior

Thanks again!

@nerdmaennchen nerdmaennchen merged commit 85a13f4 into nextcloud:master Apr 23, 2020
@violoncelloCH violoncelloCH added this to the 0.9.2 milestone Apr 24, 2020
@violoncelloCH violoncelloCH modified the milestones: 0.9.2, 0.10 May 19, 2020
@violoncelloCH violoncelloCH mentioned this pull request May 19, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting authorization header globally in basicauth.php is dangerous

3 participants