Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If not logged in -> 401 and bye-bye #27640

Merged
merged 2 commits into from
Apr 18, 2017
Merged

If not logged in -> 401 and bye-bye #27640

merged 2 commits into from
Apr 18, 2017

Conversation

DeepDiver1975
Copy link
Member

@DeepDiver1975 DeepDiver1975 commented Apr 13, 2017

Description

In case of an unauthorized request no config values are exposed.

Related Issue

#27473

Motivation and Context

Disallow information disclosure

How Has This Been Tested?

  • installation
  • login/logout
  • public link share
  • federated sharing

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@DeepDiver1975 DeepDiver1975 added this to the 10.0 milestone Apr 13, 2017
@PVince81
Copy link
Contributor

Nope: this is the wrong case. This will break public pages which need the config values.

The correct fix as discussed a bit later on was to hide the OC version from the config values if "version.hide" is set.

Basically return all config values as before except the version. Or return the version only if logged in.

@DeepDiver1975
Copy link
Member Author

Nope: this is the wrong case. This will break public pages which need the config values.

I did test public link sharing page - works.

@PVince81
Copy link
Contributor

Did you logout before testing the public page ? (incognito mode thing...)

public-page-401

@PVince81
Copy link
Contributor

JS code of the UI need access to config values. Some config values are related to theme, product name, etc. We can't remove them completely, that's why I suggest to only remove the version ones (if version.hide is true), which I think we can afford. In the event that we are unlucky that some third party apps is checking the version string, then bad luck.

@DeepDiver1975
Copy link
Member Author

Did you logout before testing the public page ? (incognito mode thing...)

okay - i did not test sharing a folder publicly ....

@@ -202,6 +193,17 @@
)
];

if (\OC::$server->getUserSession() !== null && \OC::$server->getUserSession()->isLoggedIn()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No "version.hide" config check here ?

If the version is not hidden in status.php then it's also pointless to hide it here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well - status.php is configurable in order not to break the clients.
here it simply hide if anonymous

@PVince81
Copy link
Contributor

👍

@PVince81 PVince81 merged commit f712e3b into master Apr 18, 2017
@PVince81 PVince81 deleted the authorized-access-oc.js branch April 18, 2017 08:01
@lock
Copy link

lock bot commented Aug 3, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants