Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • lemonldap-ng lemonldap-ng
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 355
    • Issues 355
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 17
    • Merge requests 17
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • LemonLDAP NGLemonLDAP NG
  • lemonldap-nglemonldap-ng
  • Issues
  • #2896

[Security][CVE-2023-28862] AuthBasic does not handle failure correctly

Concerned version

Version: 2.0.16

Summary

The AuthBasic handler works like this:

  • It computes a sessionid from login+password
  • If sessionid already exists in the session DB, authenticate user
  • Else, try to create the corresponding session by sending the login+pass to the portal RESTServer plugin

However, the only required step in the login flow is store, if anything happens after thestore step, AuthBasic will succeed because the fixed-id session has been successfully created, which means:

  • Accounts that are supposed to be 2FA-protected are not 2FA protected when AuthBasic is used
  • If a 2FA module returns an error, the first AuthBasic request will 401, but the second AuthBasic request will work correctly => VERY CONFUSING
  • Any plugin that tries to deny session after the store step will not deny AuthBasic sessions

This is probably a security issue

Possible fixes

If the AuthBasic login process fails (not PE_OK), we need to remove the session created by store and return an error

This will cause a regression: users who relied on AuthBasic working for 2FA protected account will now see failures Possible solution: use an env variable in 2FA activation rules if desired:

has2f("TOTP") and not $env->{"AuthBasic"}

or something of that sort

Assignee
Assign to
Time tracking