Wildcard in virtualhost names : URL contains a non protected host
Concerned version
Version: 2.0.7+ds-2 Debian/Bullseye
Platform: (Apache)
Summary
I configured Apache with the vhost_alias module and the VirtualDocumentRoot directive handle addresses with a wildcard like: *.dev.toto.com
Without the protection of LemonLDAP, I can access the website: http://w886cs4syyyaacgjz6gaaaax.dev.toto.com
With the protection of LemonLDAP, I am redirected to the portal with the message: Bad URL and in syslog: URL contains a non protected host (param: urldc | value: http://w886cs4syyyaacgjz6gaaaax.dev.toto.com/) Returned error: 37 (PE_BADURL)
In the configuration I have an application with the URI: http://*.dev.toto.com
In the configuration I have a virtual host with the host name "*.dev.toto.com", the default access rules is "accept", the port is at 80 and HTTPS disabled .
Logs
févr. 20 16:37:56 yog-sothoth LLNG[14126]: [debug] Access-Control-Allow-Credentials
févr. 20 16:37:56 yog-sothoth LLNG[14126]: [debug] true
févr. 20 16:37:56 yog-sothoth LLNG[14126]: [debug] Access-Control-Allow-Headers
févr. 20 16:37:56 yog-sothoth LLNG[14126]: [debug] *
févr. 20 16:37:56 yog-sothoth LLNG[14126]: [debug] Access-Control-Allow-Methods
févr. 20 16:37:56 yog-sothoth LLNG[14126]: [debug] POST,GET
févr. 20 16:37:56 yog-sothoth LLNG[14126]: [debug] Access-Control-Expose-Headers
févr. 20 16:37:56 yog-sothoth LLNG[14126]: [debug] *
févr. 20 16:37:56 yog-sothoth LLNG[14126]: [debug] Access-Control-Max-Age
févr. 20 16:37:56 yog-sothoth LLNG[14126]: [debug] 86400
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Check configuration for Lemonldap::NG::Handler::PSGI::Main
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Get configuration from cache without verification.
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Lemonldap::NG::Handler::PSGI::Main: configuration is up to date
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Get session 1d959067e04746d8c0a491627ea3974245e50df5d1fd716b5f4c770da583f180 from Handler::Main::Run
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Check session validity from Handler
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Session timeout -> 72000
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Session _utime -> 1582193658
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] now -> 1582213136
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Session timeoutActivityInterval -> 60
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Session TTL = 52522
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] No URL authentication level found...
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] auth.toto.com: Apply default rule
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] removing cookie
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Cookies -> _ga=GA1.2.1706792902.1549556697; llnglanguage=fr; lemonldaphttp=6915643e3c9fd6777d49f1715781be8361d3fec551c6dfcf87394d7e56cb5756; lemonldap=1d959067e04746d8c0a491627ea3974245e50df5d1fd716b5f4c770da583f180
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] CookieName -> lemonldap
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] newCookies -> _ga=GA1.2.1706792902.1549556697; llnglanguage=fr;
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] User fredo was granted to access to /
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Start routing default route
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Processing importHandlerData
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Processing restoreArgs
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Processing controlUrl
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Processing checkLogout
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Processing code ref
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Launching ::Password::LDAP::_modifyPassword
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Processing to JSON response
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Apply following CORS policy :
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Access-Control-Allow-Origin
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] *
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Access-Control-Allow-Credentials
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] true
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Access-Control-Allow-Headers
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] *
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Access-Control-Allow-Methods
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] POST,GET
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Access-Control-Expose-Headers
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] *
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] Access-Control-Max-Age
févr. 20 16:38:56 yog-sothoth LLNG[14126]: [debug] 86400
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [info] No cookie found
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Build URL https://auth.toto.com/?url=aHR0cDovL3c4ODZjczRzeXl5YWFjZ2p6NmdhYWFheC5kZXY1Lmp1bGlhbmEtbXVsdGltZWRpYS5jb20v
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Redirect x.x.x.x to portal (url was /?url=aHR0cDovL3c4ODZjczRzeXl5YWFjZ2p6NmdhYWFheC5kZXY1Lmp1bGlhbmEtbXVsdGltZWRpYS5jb20v)
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] User not authenticated, Try in use, cancel redirection
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Start routing default route
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Processing controlUrl
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [error] URL contains a non protected host (param: urldc | value: http://w886cs4syyyaacgjz6gaaaax.dev.toto.com/)
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] [error] URL contains a non protected host (param: urldc | value: http://w886cs4syyyaacgjz6gaaaax.dev.toto.com/)
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Returned error: 37 (PE_BADURL)
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Skin returned: login
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Calling sendHtml with template login
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Starting HTML generation using /usr/share/lemonldap-ng/portal/templates/bootstrap/login.tpl
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Sending /usr/share/lemonldap-ng/portal/templates/bootstrap/login.tpl
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Apply following CORS policy :
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Access-Control-Allow-Origin
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] *
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Access-Control-Allow-Credentials
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] true
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Access-Control-Allow-Headers
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] *
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Access-Control-Allow-Methods
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] POST,GET
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Access-Control-Expose-Headers
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] *
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Access-Control-Max-Age
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] 86400
févr. 20 16:38:57 yog-sothoth LLNG[14126]: [debug] Apply following CSP : default-src 'self';img-src 'self' data:;style-src 'self';font-src 'self';connect-src 'self';script-src 'self';form-action *;frame-ancestors 'none';
Backends used
For any bug on configuration/sessions storage, give us details on backends