core icon indicating copy to clipboard operation
core copied to clipboard

Observable Response Discrepancy - CWE - 204

Open fabiointegra opened this issue 1 year ago • 5 comments

Hello team, we did a pentest and was found a low vulnerability.

OWASP-Top10: A05:2021 – Security Misconfiguration CWE: CWE-204: Observable Response Discrepancy

Expected behaviour:

Not show information parameter: userId

Actual behaviour

When user write '/' and click reset password we have this information below: Parameter "userId" for route "core.lost.resetform" must match "[^/]++" ("/" given) to generate a corresponding URL

Environment general

Oracle Linux 8

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory

Environment ownCloud Infinite Scale

Version:10.12.2 (stable)

image

Regards, Fabio

fabiointegra avatar Oct 26 '23 13:10 fabiointegra

This is core 10.12.2

micbar avatar Oct 26 '23 14:10 micbar

Not show information parameter: userId

I fail to see any security related issue with this. userId is a routing parameter and the related code is open source anyway https://github.com/owncloud/core/blob/11076ecce92b44d82f18dcffa8696fa272410ea3/core/routes.php#L38

DeepDiver1975 avatar Oct 27 '23 07:10 DeepDiver1975

This is core 10.12.2

Sorry... was mislead by Environment ownCloud Infinite Scale in the description, but of course that was only because of the issue template.

kulmann avatar Oct 27 '23 11:10 kulmann

Sorry, my bad, It is the first issue that I open. What I would like, is change the message to end user, like user not recognized or something like that.

fabiointegra avatar Oct 27 '23 11:10 fabiointegra

Hello, I was thinking about this and for us is working in this way (avoid show route, etc): Add this javascript in /core/js/login.js and /core/js/lostpassword.js files.

$(document).ready(function() {
    $('#submit').click(function(e) {
        var userId = $('#user').val();
        var invalidChars = ['/', '*', '&', '%', '+'];
        var isInvalid = invalidChars.some(function(char) {
            return userId.includes(char);
        });
        if (isInvalid || userId.length < 5) {
            e.preventDefault();
            alert('Invalid User');
            $('#user').val('');
            $('#password').val('');		
        }
    });
});

image

image

I hope that this can help.

Regards, Fabio Lima

fabiointegra avatar Nov 15 '23 00:11 fabiointegra