force transport encryption for WebUI logins

Message ID 20170908191953.7531e069.peter.mueller@link38.eu
State Superseded
Headers
Series force transport encryption for WebUI logins |

Commit Message

Peter Müller Sept. 9, 2017, 3:19 a.m. UTC
  Force SSL/TLS for any WebUI directory which requires an authentication.
This prevents credentials from being transmitted in plaintext, which is
an information leak.

Scenario: A MITM attacker might block all encrypted traffic to the
firewall's web interface, making the administrator using an unencrypted
connection (i.e. via port 81). Username and password can be easily
logged in transit then.

Signed-off-by: Peter Müller <peter.mueller@link38.eu>
---
  

Comments

Matthias Fischer Sept. 24, 2017, 3:53 a.m. UTC | #1
Hi Peter,

Please review this patch... (http://patchwork.ipfire.org/patch/1413/)

During testing I found that every machine in my GREEN net was suddenly
able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].

No question for admin-username, no password authentification request,
nothing.

It seems as as if the Authentication Header is missing(?).

Only when I remove the "Require ssl" lines (I did this in both files), a
browser restart leads to the usual login procedure.

Best,
Matthias

On 08.09.2017 19:19, Peter Müller wrote:
> Force SSL/TLS for any WebUI directory which requires an authentication.
> This prevents credentials from being transmitted in plaintext, which is
> an information leak.
> 
> Scenario: A MITM attacker might block all encrypted traffic to the
> firewall's web interface, making the administrator using an unencrypted
> connection (i.e. via port 81). Username and password can be easily
> logged in transit then.
> 
> Signed-off-by: Peter Müller <peter.mueller@link38.eu>
> ---
> diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> index 6f353962e..5ceaa1f32 100644
> --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> @@ -24,6 +26,7 @@
>          AuthType Basic
>          AuthUserFile /var/ipfire/auth/users
>          Require user admin
> +        Require ssl
>      </DirectoryMatch>
>      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
>      <Directory /srv/web/ipfire/cgi-bin>
> @@ -33,6 +36,7 @@
>          AuthType Basic
>          AuthUserFile /var/ipfire/auth/users
>          Require user admin
> +        Require ssl
>          <Files chpasswd.cgi>
>              Require all granted
>          </Files>
> @@ -50,6 +54,7 @@
>          AuthType Basic
>          AuthUserFile /var/ipfire/auth/users
>          Require user dial admin
> +        Require ssl
>      </Directory>
>      <Files ~ "\.(cgi|shtml?)$">
>  	SSLOptions +StdEnvVars
> @@ -86,5 +91,6 @@
>          AuthType Basic
>          AuthUserFile /var/ipfire/auth/users
>          Require user admin
> +        Require ssl
>      </Directory>
>  </VirtualHost>
> diff --git a/config/httpd/vhosts.d/ipfire-interface.conf b/config/httpd/vhosts.d/ipfire-interface.conf
> index 619f90fcc..58d1b54cd 100644
> --- a/config/httpd/vhosts.d/ipfire-interface.conf
> +++ b/config/httpd/vhosts.d/ipfire-interface.conf
> @@ -16,6 +16,7 @@
>          AuthType Basic
>          AuthUserFile /var/ipfire/auth/users
>          Require user admin
> +        Require ssl
>      </DirectoryMatch>
>      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
>      <Directory /srv/web/ipfire/cgi-bin>
> @@ -25,6 +26,7 @@
>          AuthType Basic
>          AuthUserFile /var/ipfire/auth/users
>          Require user admin
> +        Require ssl
>           <Files chpasswd.cgi>
>              Require all granted
>          </Files>
> @@ -42,6 +44,7 @@
>          AuthType Basic
>          AuthUserFile /var/ipfire/auth/users
>          Require user dial admin
> +        Require ssl
>      </Directory>
>      Alias /updatecache/ /var/updatecache/
>  	<Directory /var/updatecache>
>
  
Peter Müller Sept. 24, 2017, 4:06 a.m. UTC | #2
Hello Matthias,

tanks for reporting this. I am trying to reproduce here...

Best regards,
Peter Müller

> Hi Peter,
> 
> Please review this patch... (http://patchwork.ipfire.org/patch/1413/)
> 
> During testing I found that every machine in my GREEN net was suddenly
> able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].
> 
> No question for admin-username, no password authentification request,
> nothing.
> 
> It seems as as if the Authentication Header is missing(?).
> 
> Only when I remove the "Require ssl" lines (I did this in both files), a
> browser restart leads to the usual login procedure.
> 
> Best,
> Matthias
> 
> On 08.09.2017 19:19, Peter Müller wrote:
> > Force SSL/TLS for any WebUI directory which requires an authentication.
> > This prevents credentials from being transmitted in plaintext, which is
> > an information leak.
> > 
> > Scenario: A MITM attacker might block all encrypted traffic to the
> > firewall's web interface, making the administrator using an unencrypted
> > connection (i.e. via port 81). Username and password can be easily
> > logged in transit then.
> > 
> > Signed-off-by: Peter Müller <peter.mueller@link38.eu>
> > ---
> > diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > index 6f353962e..5ceaa1f32 100644
> > --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > @@ -24,6 +26,7 @@
> >          AuthType Basic
> >          AuthUserFile /var/ipfire/auth/users
> >          Require user admin
> > +        Require ssl
> >      </DirectoryMatch>
> >      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> >      <Directory /srv/web/ipfire/cgi-bin>
> > @@ -33,6 +36,7 @@
> >          AuthType Basic
> >          AuthUserFile /var/ipfire/auth/users
> >          Require user admin
> > +        Require ssl
> >          <Files chpasswd.cgi>
> >              Require all granted
> >          </Files>
> > @@ -50,6 +54,7 @@
> >          AuthType Basic
> >          AuthUserFile /var/ipfire/auth/users
> >          Require user dial admin
> > +        Require ssl
> >      </Directory>
> >      <Files ~ "\.(cgi|shtml?)$">
> >  	SSLOptions +StdEnvVars
> > @@ -86,5 +91,6 @@
> >          AuthType Basic
> >          AuthUserFile /var/ipfire/auth/users
> >          Require user admin
> > +        Require ssl
> >      </Directory>
> >  </VirtualHost>
> > diff --git a/config/httpd/vhosts.d/ipfire-interface.conf b/config/httpd/vhosts.d/ipfire-interface.conf
> > index 619f90fcc..58d1b54cd 100644
> > --- a/config/httpd/vhosts.d/ipfire-interface.conf
> > +++ b/config/httpd/vhosts.d/ipfire-interface.conf
> > @@ -16,6 +16,7 @@
> >          AuthType Basic
> >          AuthUserFile /var/ipfire/auth/users
> >          Require user admin
> > +        Require ssl
> >      </DirectoryMatch>
> >      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> >      <Directory /srv/web/ipfire/cgi-bin>
> > @@ -25,6 +26,7 @@
> >          AuthType Basic
> >          AuthUserFile /var/ipfire/auth/users
> >          Require user admin
> > +        Require ssl
> >           <Files chpasswd.cgi>
> >              Require all granted
> >          </Files>
> > @@ -42,6 +44,7 @@
> >          AuthType Basic
> >          AuthUserFile /var/ipfire/auth/users
> >          Require user dial admin
> > +        Require ssl
> >      </Directory>
> >      Alias /updatecache/ /var/updatecache/
> >  	<Directory /var/updatecache>
> >   
>
  
Peter Müller Sept. 24, 2017, 4:19 a.m. UTC | #3
Hello Matthias,

your described scenario does not appear on my machine. :-(

However, the "Require ssl" directive seems not to work with the
2.2.x branch, here, we still need the old "SSLRequireSSL". (On
the other hand, it was intended to be used with the new version.)

Which version are you running?

I think the best solution for now is to disregard this patch.
After the Core Update with 2.4.27 version was released, I'll
give it another try.

@All: Anybody against or in favor?

Best regards,
Peter Müller

> Hello Matthias,
> 
> tanks for reporting this. I am trying to reproduce here...
> 
> Best regards,
> Peter Müller
> 
> > Hi Peter,
> > 
> > Please review this patch... (http://patchwork.ipfire.org/patch/1413/)
> > 
> > During testing I found that every machine in my GREEN net was suddenly
> > able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].
> > 
> > No question for admin-username, no password authentification request,
> > nothing.
> > 
> > It seems as as if the Authentication Header is missing(?).
> > 
> > Only when I remove the "Require ssl" lines (I did this in both files), a
> > browser restart leads to the usual login procedure.
> > 
> > Best,
> > Matthias
> > 
> > On 08.09.2017 19:19, Peter Müller wrote:  
> > > Force SSL/TLS for any WebUI directory which requires an authentication.
> > > This prevents credentials from being transmitted in plaintext, which is
> > > an information leak.
> > > 
> > > Scenario: A MITM attacker might block all encrypted traffic to the
> > > firewall's web interface, making the administrator using an unencrypted
> > > connection (i.e. via port 81). Username and password can be easily
> > > logged in transit then.
> > > 
> > > Signed-off-by: Peter Müller <peter.mueller@link38.eu>
> > > ---
> > > diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > index 6f353962e..5ceaa1f32 100644
> > > --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > @@ -24,6 +26,7 @@
> > >          AuthType Basic
> > >          AuthUserFile /var/ipfire/auth/users
> > >          Require user admin
> > > +        Require ssl
> > >      </DirectoryMatch>
> > >      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> > >      <Directory /srv/web/ipfire/cgi-bin>
> > > @@ -33,6 +36,7 @@
> > >          AuthType Basic
> > >          AuthUserFile /var/ipfire/auth/users
> > >          Require user admin
> > > +        Require ssl
> > >          <Files chpasswd.cgi>
> > >              Require all granted
> > >          </Files>
> > > @@ -50,6 +54,7 @@
> > >          AuthType Basic
> > >          AuthUserFile /var/ipfire/auth/users
> > >          Require user dial admin
> > > +        Require ssl
> > >      </Directory>
> > >      <Files ~ "\.(cgi|shtml?)$">
> > >  	SSLOptions +StdEnvVars
> > > @@ -86,5 +91,6 @@
> > >          AuthType Basic
> > >          AuthUserFile /var/ipfire/auth/users
> > >          Require user admin
> > > +        Require ssl
> > >      </Directory>
> > >  </VirtualHost>
> > > diff --git a/config/httpd/vhosts.d/ipfire-interface.conf b/config/httpd/vhosts.d/ipfire-interface.conf
> > > index 619f90fcc..58d1b54cd 100644
> > > --- a/config/httpd/vhosts.d/ipfire-interface.conf
> > > +++ b/config/httpd/vhosts.d/ipfire-interface.conf
> > > @@ -16,6 +16,7 @@
> > >          AuthType Basic
> > >          AuthUserFile /var/ipfire/auth/users
> > >          Require user admin
> > > +        Require ssl
> > >      </DirectoryMatch>
> > >      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> > >      <Directory /srv/web/ipfire/cgi-bin>
> > > @@ -25,6 +26,7 @@
> > >          AuthType Basic
> > >          AuthUserFile /var/ipfire/auth/users
> > >          Require user admin
> > > +        Require ssl
> > >           <Files chpasswd.cgi>
> > >              Require all granted
> > >          </Files>
> > > @@ -42,6 +44,7 @@
> > >          AuthType Basic
> > >          AuthUserFile /var/ipfire/auth/users
> > >          Require user dial admin
> > > +        Require ssl
> > >      </Directory>
> > >      Alias /updatecache/ /var/updatecache/
> > >  	<Directory /var/updatecache>
> > >     
> >   
>
  
Tom Rymes Sept. 24, 2017, 5:18 a.m. UTC | #4
That makes sense to me. One step at a time!

> On Sep 23, 2017, at 2:19 PM, Peter Müller <peter.mueller@link38.eu> wrote:
> 
> Hello Matthias,
> 
> your described scenario does not appear on my machine. :-(
> 
> However, the "Require ssl" directive seems not to work with the
> 2.2.x branch, here, we still need the old "SSLRequireSSL". (On
> the other hand, it was intended to be used with the new version.)
> 
> Which version are you running?
> 
> I think the best solution for now is to disregard this patch.
> After the Core Update with 2.4.27 version was released, I'll
> give it another try.
> 
> @All: Anybody against or in favor?
> 
> Best regards,
> Peter Müller
> 
>> Hello Matthias,
>> 
>> tanks for reporting this. I am trying to reproduce here...
>> 
>> Best regards,
>> Peter Müller
>> 
>>> Hi Peter,
>>> 
>>> Please review this patch... (http://patchwork.ipfire.org/patch/1413/)
>>> 
>>> During testing I found that every machine in my GREEN net was suddenly
>>> able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].
>>> 
>>> No question for admin-username, no password authentification request,
>>> nothing.
>>> 
>>> It seems as as if the Authentication Header is missing(?).
>>> 
>>> Only when I remove the "Require ssl" lines (I did this in both files), a
>>> browser restart leads to the usual login procedure.
>>> 
>>> Best,
>>> Matthias
>>> 
>>>> On 08.09.2017 19:19, Peter Müller wrote:  
>>>> Force SSL/TLS for any WebUI directory which requires an authentication.
>>>> This prevents credentials from being transmitted in plaintext, which is
>>>> an information leak.
>>>> 
>>>> Scenario: A MITM attacker might block all encrypted traffic to the
>>>> firewall's web interface, making the administrator using an unencrypted
>>>> connection (i.e. via port 81). Username and password can be easily
>>>> logged in transit then.
>>>> 
>>>> Signed-off-by: Peter Müller <peter.mueller@link38.eu>
>>>> ---
>>>> diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
>>>> index 6f353962e..5ceaa1f32 100644
>>>> --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
>>>> +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
>>>> @@ -24,6 +26,7 @@
>>>>         AuthType Basic
>>>>         AuthUserFile /var/ipfire/auth/users
>>>>         Require user admin
>>>> +        Require ssl
>>>>     </DirectoryMatch>
>>>>     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
>>>>     <Directory /srv/web/ipfire/cgi-bin>
>>>> @@ -33,6 +36,7 @@
>>>>         AuthType Basic
>>>>         AuthUserFile /var/ipfire/auth/users
>>>>         Require user admin
>>>> +        Require ssl
>>>>         <Files chpasswd.cgi>
>>>>             Require all granted
>>>>         </Files>
>>>> @@ -50,6 +54,7 @@
>>>>         AuthType Basic
>>>>         AuthUserFile /var/ipfire/auth/users
>>>>         Require user dial admin
>>>> +        Require ssl
>>>>     </Directory>
>>>>     <Files ~ "\.(cgi|shtml?)$">
>>>>    SSLOptions +StdEnvVars
>>>> @@ -86,5 +91,6 @@
>>>>         AuthType Basic
>>>>         AuthUserFile /var/ipfire/auth/users
>>>>         Require user admin
>>>> +        Require ssl
>>>>     </Directory>
>>>> </VirtualHost>
>>>> diff --git a/config/httpd/vhosts.d/ipfire-interface.conf b/config/httpd/vhosts.d/ipfire-interface.conf
>>>> index 619f90fcc..58d1b54cd 100644
>>>> --- a/config/httpd/vhosts.d/ipfire-interface.conf
>>>> +++ b/config/httpd/vhosts.d/ipfire-interface.conf
>>>> @@ -16,6 +16,7 @@
>>>>         AuthType Basic
>>>>         AuthUserFile /var/ipfire/auth/users
>>>>         Require user admin
>>>> +        Require ssl
>>>>     </DirectoryMatch>
>>>>     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
>>>>     <Directory /srv/web/ipfire/cgi-bin>
>>>> @@ -25,6 +26,7 @@
>>>>         AuthType Basic
>>>>         AuthUserFile /var/ipfire/auth/users
>>>>         Require user admin
>>>> +        Require ssl
>>>>          <Files chpasswd.cgi>
>>>>             Require all granted
>>>>         </Files>
>>>> @@ -42,6 +44,7 @@
>>>>         AuthType Basic
>>>>         AuthUserFile /var/ipfire/auth/users
>>>>         Require user dial admin
>>>> +        Require ssl
>>>>     </Directory>
>>>>     Alias /updatecache/ /var/updatecache/
>>>>    <Directory /var/updatecache>
>>>> 
>>> 
>> 
> 
>
  
Michael Tremer Sept. 24, 2017, 5:26 a.m. UTC | #5
Hi,

On Sat, 2017-09-23 at 15:18 -0400, Tom Rymes wrote:
> That makes sense to me. One step at a time!
> 
> > On Sep 23, 2017, at 2:19 PM, Peter Müller <peter.mueller@link38.eu> wrote:
> > 
> > Hello Matthias,
> > 
> > your described scenario does not appear on my machine. :-(
> > 
> > However, the "Require ssl" directive seems not to work with the
> > 2.2.x branch, here, we still need the old "SSLRequireSSL". (On
> > the other hand, it was intended to be used with the new version.)
> > 
> > Which version are you running?
> > 
> > I think the best solution for now is to disregard this patch.
> > After the Core Update with 2.4.27 version was released, I'll
> > give it another try.

Well, the update for Apache 2.4 is in next right now.

If there is any doubt on whether SSL is always enforced or not we should
investigate as soon as possible. I don't think that we should wait too much
longer with the entire update any ways, but this certainly delays it.

Best,
-Michael

> > 
> > @All: Anybody against or in favor?
> > 
> > Best regards,
> > Peter Müller
> > 
> > > Hello Matthias,
> > > 
> > > tanks for reporting this. I am trying to reproduce here...
> > > 
> > > Best regards,
> > > Peter Müller
> > > 
> > > > Hi Peter,
> > > > 
> > > > Please review this patch... (http://patchwork.ipfire.org/patch/1413/)
> > > > 
> > > > During testing I found that every machine in my GREEN net was suddenly
> > > > able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].
> > > > 
> > > > No question for admin-username, no password authentification request,
> > > > nothing.
> > > > 
> > > > It seems as as if the Authentication Header is missing(?).
> > > > 
> > > > Only when I remove the "Require ssl" lines (I did this in both files), a
> > > > browser restart leads to the usual login procedure.
> > > > 
> > > > Best,
> > > > Matthias
> > > > 
> > > > > On 08.09.2017 19:19, Peter Müller wrote:  
> > > > > Force SSL/TLS for any WebUI directory which requires an
> > > > > authentication.
> > > > > This prevents credentials from being transmitted in plaintext, which
> > > > > is
> > > > > an information leak.
> > > > > 
> > > > > Scenario: A MITM attacker might block all encrypted traffic to the
> > > > > firewall's web interface, making the administrator using an
> > > > > unencrypted
> > > > > connection (i.e. via port 81). Username and password can be easily
> > > > > logged in transit then.
> > > > > 
> > > > > Signed-off-by: Peter Müller <peter.mueller@link38.eu>
> > > > > ---
> > > > > diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > index 6f353962e..5ceaa1f32 100644
> > > > > --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > @@ -24,6 +26,7 @@
> > > > >         AuthType Basic
> > > > >         AuthUserFile /var/ipfire/auth/users
> > > > >         Require user admin
> > > > > +        Require ssl
> > > > >     </DirectoryMatch>
> > > > >     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> > > > >     <Directory /srv/web/ipfire/cgi-bin>
> > > > > @@ -33,6 +36,7 @@
> > > > >         AuthType Basic
> > > > >         AuthUserFile /var/ipfire/auth/users
> > > > >         Require user admin
> > > > > +        Require ssl
> > > > >         <Files chpasswd.cgi>
> > > > >             Require all granted
> > > > >         </Files>
> > > > > @@ -50,6 +54,7 @@
> > > > >         AuthType Basic
> > > > >         AuthUserFile /var/ipfire/auth/users
> > > > >         Require user dial admin
> > > > > +        Require ssl
> > > > >     </Directory>
> > > > >     <Files ~ "\.(cgi|shtml?)$">
> > > > >    SSLOptions +StdEnvVars
> > > > > @@ -86,5 +91,6 @@
> > > > >         AuthType Basic
> > > > >         AuthUserFile /var/ipfire/auth/users
> > > > >         Require user admin
> > > > > +        Require ssl
> > > > >     </Directory>
> > > > > </VirtualHost>
> > > > > diff --git a/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > b/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > index 619f90fcc..58d1b54cd 100644
> > > > > --- a/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > +++ b/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > @@ -16,6 +16,7 @@
> > > > >         AuthType Basic
> > > > >         AuthUserFile /var/ipfire/auth/users
> > > > >         Require user admin
> > > > > +        Require ssl
> > > > >     </DirectoryMatch>
> > > > >     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> > > > >     <Directory /srv/web/ipfire/cgi-bin>
> > > > > @@ -25,6 +26,7 @@
> > > > >         AuthType Basic
> > > > >         AuthUserFile /var/ipfire/auth/users
> > > > >         Require user admin
> > > > > +        Require ssl
> > > > >          <Files chpasswd.cgi>
> > > > >             Require all granted
> > > > >         </Files>
> > > > > @@ -42,6 +44,7 @@
> > > > >         AuthType Basic
> > > > >         AuthUserFile /var/ipfire/auth/users
> > > > >         Require user dial admin
> > > > > +        Require ssl
> > > > >     </Directory>
> > > > >     Alias /updatecache/ /var/updatecache/
> > > > >    <Directory /var/updatecache>
> > > > > 
> > 
> >
  
Matthias Fischer Sept. 24, 2017, 5:35 a.m. UTC | #6
On 23.09.2017 20:19, Peter Müller wrote:
> Hello Matthias,
> 
> your described scenario does not appear on my machine. :-(

Hm... Weird.

> However, the "Require ssl" directive seems not to work with the
> 2.2.x branch, here, we still need the old "SSLRequireSSL". (On
> the other hand, it was intended to be used with the new version.)
> 
> Which version are you running?

Sorry, forgot. I'm using 2.4.27 from current 'next', built today, on
Core 113.

> I think the best solution for now is to disregard this patch.
> After the Core Update with 2.4.27 version was released, I'll
> give it another try.

See above... It won't work here: I just verified this behaviour on my
test machine. *With* "Require ssl" I get instant (https-)access,
*without* "Require ssl" I'm asked for username / password.

Best,
Matthias

> @All: Anybody against or in favor?
> 
> Best regards,
> Peter Müller
> 
>> Hello Matthias,
>> 
>> tanks for reporting this. I am trying to reproduce here...
>> 
>> Best regards,
>> Peter Müller
>> 
>> > Hi Peter,
>> > 
>> > Please review this patch... (http://patchwork.ipfire.org/patch/1413/)
>> > 
>> > During testing I found that every machine in my GREEN net was suddenly
>> > able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].
>> > 
>> > No question for admin-username, no password authentification request,
>> > nothing.
>> > 
>> > It seems as as if the Authentication Header is missing(?).
>> > 
>> > Only when I remove the "Require ssl" lines (I did this in both files), a
>> > browser restart leads to the usual login procedure.
>> > 
>> > Best,
>> > Matthias
>> > 
>> > On 08.09.2017 19:19, Peter Müller wrote:  
>> > > Force SSL/TLS for any WebUI directory which requires an authentication.
>> > > This prevents credentials from being transmitted in plaintext, which is
>> > > an information leak.
>> > > 
>> > > Scenario: A MITM attacker might block all encrypted traffic to the
>> > > firewall's web interface, making the administrator using an unencrypted
>> > > connection (i.e. via port 81). Username and password can be easily
>> > > logged in transit then.
>> > > 
>> > > Signed-off-by: Peter Müller <peter.mueller@link38.eu>
>> > > ---
>> > > diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
>> > > index 6f353962e..5ceaa1f32 100644
>> > > --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
>> > > +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
>> > > @@ -24,6 +26,7 @@
>> > >          AuthType Basic
>> > >          AuthUserFile /var/ipfire/auth/users
>> > >          Require user admin
>> > > +        Require ssl
>> > >      </DirectoryMatch>
>> > >      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
>> > >      <Directory /srv/web/ipfire/cgi-bin>
>> > > @@ -33,6 +36,7 @@
>> > >          AuthType Basic
>> > >          AuthUserFile /var/ipfire/auth/users
>> > >          Require user admin
>> > > +        Require ssl
>> > >          <Files chpasswd.cgi>
>> > >              Require all granted
>> > >          </Files>
>> > > @@ -50,6 +54,7 @@
>> > >          AuthType Basic
>> > >          AuthUserFile /var/ipfire/auth/users
>> > >          Require user dial admin
>> > > +        Require ssl
>> > >      </Directory>
>> > >      <Files ~ "\.(cgi|shtml?)$">
>> > >  	SSLOptions +StdEnvVars
>> > > @@ -86,5 +91,6 @@
>> > >          AuthType Basic
>> > >          AuthUserFile /var/ipfire/auth/users
>> > >          Require user admin
>> > > +        Require ssl
>> > >      </Directory>
>> > >  </VirtualHost>
>> > > diff --git a/config/httpd/vhosts.d/ipfire-interface.conf b/config/httpd/vhosts.d/ipfire-interface.conf
>> > > index 619f90fcc..58d1b54cd 100644
>> > > --- a/config/httpd/vhosts.d/ipfire-interface.conf
>> > > +++ b/config/httpd/vhosts.d/ipfire-interface.conf
>> > > @@ -16,6 +16,7 @@
>> > >          AuthType Basic
>> > >          AuthUserFile /var/ipfire/auth/users
>> > >          Require user admin
>> > > +        Require ssl
>> > >      </DirectoryMatch>
>> > >      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
>> > >      <Directory /srv/web/ipfire/cgi-bin>
>> > > @@ -25,6 +26,7 @@
>> > >          AuthType Basic
>> > >          AuthUserFile /var/ipfire/auth/users
>> > >          Require user admin
>> > > +        Require ssl
>> > >           <Files chpasswd.cgi>
>> > >              Require all granted
>> > >          </Files>
>> > > @@ -42,6 +44,7 @@
>> > >          AuthType Basic
>> > >          AuthUserFile /var/ipfire/auth/users
>> > >          Require user dial admin
>> > > +        Require ssl
>> > >      </Directory>
>> > >      Alias /updatecache/ /var/updatecache/
>> > >  	<Directory /var/updatecache>
>> > >     
>> >   
>> 
> 
> 
>
  
Peter Müller Sept. 24, 2017, 5:56 a.m. UTC | #7
Hello,

> Hi,
> 
> On Sat, 2017-09-23 at 15:18 -0400, Tom Rymes wrote:
> > That makes sense to me. One step at a time!
> >   
> > > On Sep 23, 2017, at 2:19 PM, Peter Müller <peter.mueller@link38.eu> wrote:
> > > 
> > > Hello Matthias,
> > > 
> > > your described scenario does not appear on my machine. :-(
> > > 
> > > However, the "Require ssl" directive seems not to work with the
> > > 2.2.x branch, here, we still need the old "SSLRequireSSL". (On
> > > the other hand, it was intended to be used with the new version.)
> > > 
> > > Which version are you running?
> > > 
> > > I think the best solution for now is to disregard this patch.
> > > After the Core Update with 2.4.27 version was released, I'll
> > > give it another try.  
> 
> Well, the update for Apache 2.4 is in next right now.
Yes, I saw Arne closing Core114 a few hours ago.
> 
> If there is any doubt on whether SSL is always enforced or not we should
> investigate as soon as possible. I don't think that we should wait too much
> longer with the entire update any ways, but this certainly delays it.
SSL enforcement is not the problem here. The problem is to make sure SSL
is enforced in case sensitive data (logins, configuration settings, ...) are
transmitted.

Enforcing SSL globally on IPFire is not possible AFAIK, since we need some
plaintext transfer for Squid error messages, and the update accelerator, and
things like that.

At the moment - without the patch I sent in - it is possible to log in
to the WebUI without SSL by using port 81.

The patch was intended for Apache 2.4.x, since on 2.2.x, the "Require ssl"
is just ignored. On the other hand, "SSLRequireSSL" would work on both
versions, but is depreached in 2.4.x.

Since I cannot reproduce the scenario Matthias wrote, I strongly recommend
not to apply the patch until this has been clarified. If possible, I will
test this in a VDI/Nightly Build image tomorrow.

Besides from that, there are two aspects to discuss in the meantime: :-)
(a) Looking at the actual configuration files in "/etc/httpd/conf/vhosts.d/",
it might make sense to delete all directory blocks in the "ipfire-interface.conf"
which require an authentication and replace them with a HTTP 301 redirect to
the SSL location.

That way, even if Apache ignores the whatever-named directive to force
SSL, transmitting login data in plaintext is not possible. Thinking
about this, I like this idea better than my original one.

Resources without authentication must remain untouched (as mentioned above).

(b) Although this is a security vulnerability, it is not a very severe one
in the default configuration - as far as I am concerned.

It requires a MITM between IPFire and the administrator's computer, and
an admin who accesses the unencrypted resource on port 81 every time or
in case the MITM blocked encrypted connections to 444.

Of course, in case anybody created a firewall rule allowing traffic from
RED to IPFire's internal port 81 and 444, this issue becomes quite critical.
According to Shodan, a lot of people do so.

To sum it up: We/I should fix this as soon as possible, but in case it
needs some more time, it's severity does not require a delay to Core 114
as far as I am concerned.


I would be happy to get feedback, especially to (a).

Hopefully, I have a working patch ready by tomorrow evening.

Best regards,
Peter Müller

@Michael P.S.: What about the other patches (ECDSA, SSL ciphers and all
the minor WebUI stuff)? Are they not working, too?

> 
> Best,
> -Michael
> 
> > > 
> > > @All: Anybody against or in favor?
> > > 
> > > Best regards,
> > > Peter Müller
> > >   
> > > > Hello Matthias,
> > > > 
> > > > tanks for reporting this. I am trying to reproduce here...
> > > > 
> > > > Best regards,
> > > > Peter Müller
> > > >   
> > > > > Hi Peter,
> > > > > 
> > > > > Please review this patch... (http://patchwork.ipfire.org/patch/1413/)
> > > > > 
> > > > > During testing I found that every machine in my GREEN net was suddenly
> > > > > able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].
> > > > > 
> > > > > No question for admin-username, no password authentification request,
> > > > > nothing.
> > > > > 
> > > > > It seems as as if the Authentication Header is missing(?).
> > > > > 
> > > > > Only when I remove the "Require ssl" lines (I did this in both files), a
> > > > > browser restart leads to the usual login procedure.
> > > > > 
> > > > > Best,
> > > > > Matthias
> > > > >   
> > > > > > On 08.09.2017 19:19, Peter Müller wrote:  
> > > > > > Force SSL/TLS for any WebUI directory which requires an
> > > > > > authentication.
> > > > > > This prevents credentials from being transmitted in plaintext, which
> > > > > > is
> > > > > > an information leak.
> > > > > > 
> > > > > > Scenario: A MITM attacker might block all encrypted traffic to the
> > > > > > firewall's web interface, making the administrator using an
> > > > > > unencrypted
> > > > > > connection (i.e. via port 81). Username and password can be easily
> > > > > > logged in transit then.
> > > > > > 
> > > > > > Signed-off-by: Peter Müller <peter.mueller@link38.eu>
> > > > > > ---
> > > > > > diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > index 6f353962e..5ceaa1f32 100644
> > > > > > --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > @@ -24,6 +26,7 @@
> > > > > >         AuthType Basic
> > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > >         Require user admin
> > > > > > +        Require ssl
> > > > > >     </DirectoryMatch>
> > > > > >     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> > > > > >     <Directory /srv/web/ipfire/cgi-bin>
> > > > > > @@ -33,6 +36,7 @@
> > > > > >         AuthType Basic
> > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > >         Require user admin
> > > > > > +        Require ssl
> > > > > >         <Files chpasswd.cgi>
> > > > > >             Require all granted
> > > > > >         </Files>
> > > > > > @@ -50,6 +54,7 @@
> > > > > >         AuthType Basic
> > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > >         Require user dial admin
> > > > > > +        Require ssl
> > > > > >     </Directory>
> > > > > >     <Files ~ "\.(cgi|shtml?)$">
> > > > > >    SSLOptions +StdEnvVars
> > > > > > @@ -86,5 +91,6 @@
> > > > > >         AuthType Basic
> > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > >         Require user admin
> > > > > > +        Require ssl
> > > > > >     </Directory>
> > > > > > </VirtualHost>
> > > > > > diff --git a/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > b/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > index 619f90fcc..58d1b54cd 100644
> > > > > > --- a/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > +++ b/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > @@ -16,6 +16,7 @@
> > > > > >         AuthType Basic
> > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > >         Require user admin
> > > > > > +        Require ssl
> > > > > >     </DirectoryMatch>
> > > > > >     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> > > > > >     <Directory /srv/web/ipfire/cgi-bin>
> > > > > > @@ -25,6 +26,7 @@
> > > > > >         AuthType Basic
> > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > >         Require user admin
> > > > > > +        Require ssl
> > > > > >          <Files chpasswd.cgi>
> > > > > >             Require all granted
> > > > > >         </Files>
> > > > > > @@ -42,6 +44,7 @@
> > > > > >         AuthType Basic
> > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > >         Require user dial admin
> > > > > > +        Require ssl
> > > > > >     </Directory>
> > > > > >     Alias /updatecache/ /var/updatecache/
> > > > > >    <Directory /var/updatecache>
> > > > > >   
> > > 
> > >
  
Peter Müller Sept. 24, 2017, 6:08 a.m. UTC | #8
Hello Matthias,

thanks for the quick reply.

> On 23.09.2017 20:19, Peter Müller wrote:
> > Hello Matthias,
> > 
> > your described scenario does not appear on my machine. :-(  
> 
> Hm... Weird.
> 
> > However, the "Require ssl" directive seems not to work with the
> > 2.2.x branch, here, we still need the old "SSLRequireSSL". (On
> > the other hand, it was intended to be used with the new version.)
> > 
> > Which version are you running?  
> 
> Sorry, forgot. I'm using 2.4.27 from current 'next', built today, on
> Core 113.
Ah, I was still at 2.2.x (where the patch has no effect) and tested
against a 2.4.x web server I had at hand.

Promise to test better next time.
> 
> > I think the best solution for now is to disregard this patch.
> > After the Core Update with 2.4.27 version was released, I'll
> > give it another try.  
> 
> See above... It won't work here: I just verified this behaviour on my
> test machine. *With* "Require ssl" I get instant (https-)access,
> *without* "Require ssl" I'm asked for username / password.
Well, according to the Apache docs (https://httpd.apache.org/docs/current/mod/mod_ssl.html#reqssl),
one cannot assume that this breaks "Require valid-user". Looks somehow
like a bug in Apache...

I think I will just replace the directories with HTTP 301 in the
unencrypted file (as I mentioned in the other mail), but for the
"ipfire-interface-ssl.conf" file, we can assume SSL is used, anyway.

We _can_ assume, but we are not sure. :-|

Will use a nightly build tomorrow and develop a better patch.

Best regards,
Peter Müller


> 
> Best,
> Matthias
> 
> > @All: Anybody against or in favor?
> > 
> > Best regards,
> > Peter Müller
> >   
> >> Hello Matthias,
> >> 
> >> tanks for reporting this. I am trying to reproduce here...
> >> 
> >> Best regards,
> >> Peter Müller
> >>   
> >> > Hi Peter,
> >> > 
> >> > Please review this patch... (http://patchwork.ipfire.org/patch/1413/)
> >> > 
> >> > During testing I found that every machine in my GREEN net was suddenly
> >> > able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].
> >> > 
> >> > No question for admin-username, no password authentification request,
> >> > nothing.
> >> > 
> >> > It seems as as if the Authentication Header is missing(?).
> >> > 
> >> > Only when I remove the "Require ssl" lines (I did this in both files), a
> >> > browser restart leads to the usual login procedure.
> >> > 
> >> > Best,
> >> > Matthias
> >> > 
> >> > On 08.09.2017 19:19, Peter Müller wrote:    
> >> > > Force SSL/TLS for any WebUI directory which requires an authentication.
> >> > > This prevents credentials from being transmitted in plaintext, which is
> >> > > an information leak.
> >> > > 
> >> > > Scenario: A MITM attacker might block all encrypted traffic to the
> >> > > firewall's web interface, making the administrator using an unencrypted
> >> > > connection (i.e. via port 81). Username and password can be easily
> >> > > logged in transit then.
> >> > > 
> >> > > Signed-off-by: Peter Müller <peter.mueller@link38.eu>
> >> > > ---
> >> > > diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> >> > > index 6f353962e..5ceaa1f32 100644
> >> > > --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> >> > > +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> >> > > @@ -24,6 +26,7 @@
> >> > >          AuthType Basic
> >> > >          AuthUserFile /var/ipfire/auth/users
> >> > >          Require user admin
> >> > > +        Require ssl
> >> > >      </DirectoryMatch>
> >> > >      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> >> > >      <Directory /srv/web/ipfire/cgi-bin>
> >> > > @@ -33,6 +36,7 @@
> >> > >          AuthType Basic
> >> > >          AuthUserFile /var/ipfire/auth/users
> >> > >          Require user admin
> >> > > +        Require ssl
> >> > >          <Files chpasswd.cgi>
> >> > >              Require all granted
> >> > >          </Files>
> >> > > @@ -50,6 +54,7 @@
> >> > >          AuthType Basic
> >> > >          AuthUserFile /var/ipfire/auth/users
> >> > >          Require user dial admin
> >> > > +        Require ssl
> >> > >      </Directory>
> >> > >      <Files ~ "\.(cgi|shtml?)$">
> >> > >  	SSLOptions +StdEnvVars
> >> > > @@ -86,5 +91,6 @@
> >> > >          AuthType Basic
> >> > >          AuthUserFile /var/ipfire/auth/users
> >> > >          Require user admin
> >> > > +        Require ssl
> >> > >      </Directory>
> >> > >  </VirtualHost>
> >> > > diff --git a/config/httpd/vhosts.d/ipfire-interface.conf b/config/httpd/vhosts.d/ipfire-interface.conf
> >> > > index 619f90fcc..58d1b54cd 100644
> >> > > --- a/config/httpd/vhosts.d/ipfire-interface.conf
> >> > > +++ b/config/httpd/vhosts.d/ipfire-interface.conf
> >> > > @@ -16,6 +16,7 @@
> >> > >          AuthType Basic
> >> > >          AuthUserFile /var/ipfire/auth/users
> >> > >          Require user admin
> >> > > +        Require ssl
> >> > >      </DirectoryMatch>
> >> > >      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> >> > >      <Directory /srv/web/ipfire/cgi-bin>
> >> > > @@ -25,6 +26,7 @@
> >> > >          AuthType Basic
> >> > >          AuthUserFile /var/ipfire/auth/users
> >> > >          Require user admin
> >> > > +        Require ssl
> >> > >           <Files chpasswd.cgi>
> >> > >              Require all granted
> >> > >          </Files>
> >> > > @@ -42,6 +44,7 @@
> >> > >          AuthType Basic
> >> > >          AuthUserFile /var/ipfire/auth/users
> >> > >          Require user dial admin
> >> > > +        Require ssl
> >> > >      </Directory>
> >> > >      Alias /updatecache/ /var/updatecache/
> >> > >  	<Directory /var/updatecache>
> >> > >       
> >> >     
> >>   
> > 
> > 
> >   
>
  
Michael Tremer Sept. 24, 2017, 7:03 a.m. UTC | #9
Hi,

On Sat, 2017-09-23 at 21:56 +0200, Peter Müller wrote:
> Hello,
> 
> > Hi,
> > 
> > On Sat, 2017-09-23 at 15:18 -0400, Tom Rymes wrote:
> > > That makes sense to me. One step at a time!
> > >   
> > > > On Sep 23, 2017, at 2:19 PM, Peter Müller <peter.mueller@link38.eu> wrote:
> > > > 
> > > > Hello Matthias,
> > > > 
> > > > your described scenario does not appear on my machine. :-(
> > > > 
> > > > However, the "Require ssl" directive seems not to work with the
> > > > 2.2.x branch, here, we still need the old "SSLRequireSSL". (On
> > > > the other hand, it was intended to be used with the new version.)
> > > > 
> > > > Which version are you running?
> > > > 
> > > > I think the best solution for now is to disregard this patch.
> > > > After the Core Update with 2.4.27 version was released, I'll
> > > > give it another try.  
> > 
> > Well, the update for Apache 2.4 is in next right now.
> 
> Yes, I saw Arne closing Core114 a few hours ago.

Oh. :)

> > 
> > If there is any doubt on whether SSL is always enforced or not we should
> > investigate as soon as possible. I don't think that we should wait too much
> > longer with the entire update any ways, but this certainly delays it.
> 
> SSL enforcement is not the problem here. The problem is to make sure SSL
> is enforced in case sensitive data (logins, configuration settings, ...) are
> transmitted.
> 
> Enforcing SSL globally on IPFire is not possible AFAIK, since we need some
> plaintext transfer for Squid error messages, and the update accelerator, and
> things like that.
> 
> At the moment - without the patch I sent in - it is possible to log in
> to the WebUI without SSL by using port 81.
> 
> The patch was intended for Apache 2.4.x, since on 2.2.x, the "Require ssl"
> is just ignored. On the other hand, "SSLRequireSSL" would work on both
> versions, but is depreached in 2.4.x.
> 
> Since I cannot reproduce the scenario Matthias wrote, I strongly recommend
> not to apply the patch until this has been clarified. If possible, I will
> test this in a VDI/Nightly Build image tomorrow.
> 
> Besides from that, there are two aspects to discuss in the meantime: :-)
> (a) Looking at the actual configuration files in "/etc/httpd/conf/vhosts.d/",
> it might make sense to delete all directory blocks in the "ipfire-interface.conf"
> which require an authentication and replace them with a HTTP 301 redirect to
> the SSL location.
> 
> That way, even if Apache ignores the whatever-named directive to force
> SSL, transmitting login data in plaintext is not possible. Thinking
> about this, I like this idea better than my original one.
> 
> Resources without authentication must remain untouched (as mentioned above).

Agreed. This is what we should do. Looking back I have no idea why this
was ever done this way. I remember historically the web if didn't have
SSL and it was added later, but not all browsers supported it. So HTTP
was meant to be working as well as HTTPS.

Since we have had this issue before Apache 2.4, I guess it does not
make sense to delay the update for it.

> (b) Although this is a security vulnerability, it is not a very severe one
> in the default configuration - as far as I am concerned.
> 
> It requires a MITM between IPFire and the administrator's computer, and
> an admin who accesses the unencrypted resource on port 81 every time or
> in case the MITM blocked encrypted connections to 444.

Since we use SSL and nobody can properly validate the certificate, MITM
is always super easy to do to be honest.

> Of course, in case anybody created a firewall rule allowing traffic from
> RED to IPFire's internal port 81 and 444, this issue becomes quite critical.
> According to Shodan, a lot of people do so.

Those misconfigured a lot. They are on their own.

> To sum it up: We/I should fix this as soon as possible, but in case it
> needs some more time, it's severity does not require a delay to Core 114
> as far as I am concerned.

See above.

> I would be happy to get feedback, especially to (a).
> 
> Hopefully, I have a working patch ready by tomorrow evening.
> 
> Best regards,
> Peter Müller
> 
> @Michael P.S.: What about the other patches (ECDSA, SSL ciphers and all
> the minor WebUI stuff)? Are they not working, too?

No, not yet. Things have been very busy around me and this is solely on
me.

> 
> > 
> > Best,
> > -Michael
> > 
> > > > 
> > > > @All: Anybody against or in favor?
> > > > 
> > > > Best regards,
> > > > Peter Müller
> > > >   
> > > > > Hello Matthias,
> > > > > 
> > > > > tanks for reporting this. I am trying to reproduce here...
> > > > > 
> > > > > Best regards,
> > > > > Peter Müller
> > > > >   
> > > > > > Hi Peter,
> > > > > > 
> > > > > > Please review this patch... (http://patchwork.ipfire.org/patch/1413/)
> > > > > > 
> > > > > > During testing I found that every machine in my GREEN net was suddenly
> > > > > > able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].
> > > > > > 
> > > > > > No question for admin-username, no password authentification request,
> > > > > > nothing.
> > > > > > 
> > > > > > It seems as as if the Authentication Header is missing(?).
> > > > > > 
> > > > > > Only when I remove the "Require ssl" lines (I did this in both files), a
> > > > > > browser restart leads to the usual login procedure.
> > > > > > 
> > > > > > Best,
> > > > > > Matthias
> > > > > >   
> > > > > > > On 08.09.2017 19:19, Peter Müller wrote:  
> > > > > > > Force SSL/TLS for any WebUI directory which requires an
> > > > > > > authentication.
> > > > > > > This prevents credentials from being transmitted in plaintext, which
> > > > > > > is
> > > > > > > an information leak.
> > > > > > > 
> > > > > > > Scenario: A MITM attacker might block all encrypted traffic to the
> > > > > > > firewall's web interface, making the administrator using an
> > > > > > > unencrypted
> > > > > > > connection (i.e. via port 81). Username and password can be easily
> > > > > > > logged in transit then.
> > > > > > > 
> > > > > > > Signed-off-by: Peter Müller <peter.mueller@link38.eu>
> > > > > > > ---
> > > > > > > diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > > b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > > index 6f353962e..5ceaa1f32 100644
> > > > > > > --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > > +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > > @@ -24,6 +26,7 @@
> > > > > > >         AuthType Basic
> > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > >         Require user admin
> > > > > > > +        Require ssl
> > > > > > >     </DirectoryMatch>
> > > > > > >     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> > > > > > >     <Directory /srv/web/ipfire/cgi-bin>
> > > > > > > @@ -33,6 +36,7 @@
> > > > > > >         AuthType Basic
> > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > >         Require user admin
> > > > > > > +        Require ssl
> > > > > > >         <Files chpasswd.cgi>
> > > > > > >             Require all granted
> > > > > > >         </Files>
> > > > > > > @@ -50,6 +54,7 @@
> > > > > > >         AuthType Basic
> > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > >         Require user dial admin
> > > > > > > +        Require ssl
> > > > > > >     </Directory>
> > > > > > >     <Files ~ "\.(cgi|shtml?)$">
> > > > > > >    SSLOptions +StdEnvVars
> > > > > > > @@ -86,5 +91,6 @@
> > > > > > >         AuthType Basic
> > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > >         Require user admin
> > > > > > > +        Require ssl
> > > > > > >     </Directory>
> > > > > > > </VirtualHost>
> > > > > > > diff --git a/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > > b/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > > index 619f90fcc..58d1b54cd 100644
> > > > > > > --- a/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > > +++ b/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > > @@ -16,6 +16,7 @@
> > > > > > >         AuthType Basic
> > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > >         Require user admin
> > > > > > > +        Require ssl
> > > > > > >     </DirectoryMatch>
> > > > > > >     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> > > > > > >     <Directory /srv/web/ipfire/cgi-bin>
> > > > > > > @@ -25,6 +26,7 @@
> > > > > > >         AuthType Basic
> > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > >         Require user admin
> > > > > > > +        Require ssl
> > > > > > >          <Files chpasswd.cgi>
> > > > > > >             Require all granted
> > > > > > >         </Files>
> > > > > > > @@ -42,6 +44,7 @@
> > > > > > >         AuthType Basic
> > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > >         Require user dial admin
> > > > > > > +        Require ssl
> > > > > > >     </Directory>
> > > > > > >     Alias /updatecache/ /var/updatecache/
> > > > > > >    <Directory /var/updatecache>
> > > > > > >   
> > > > 
> > > >   
> 
>
  
tbuchanan@vinu.edu Sept. 24, 2017, 7:48 a.m. UTC | #10
Sent from IBM Verse


   Peter Müller --- Re: [PATCH] force transport encryption for WebUI logins --- 
    From:"Peter Müller" <peter.mueller@link38.eu>To:"Matthias Fischer" <matthias.fischer@ipfire.org>Cc:development@lists.ipfire.orgDate:Sat, Sep 23, 2017 3:08 PMSubject:Re: [PATCH] force transport encryption for WebUI logins
  
    Hello Matthias,thanks for the quick reply.> On 23.09.2017 20:19, Peter Müller wrote:> > Hello Matthias,> > > > your described scenario does not appear on my machine. :-(  > > Hm... Weird.> > > However, the "Require ssl" directive seems not to work with the> > 2.2.x branch, here, we still need the old "SSLRequireSSL". (On> > the other hand, it was intended to be used with the new version.)> > > > Which version are you running?  > > Sorry, forgot. I'm using 2.4.27 from current 'next', built today, on> Core 113.Ah, I was still at 2.2.x (where the patch has no effect) and testedagainst a 2.4.x web server I had at hand.Promise to test better next time.> > > I think the best solution for now is to disregard this patch.> > After the Core Update with 2.4.27 version was released, I'll> > give it another try.  > > See above... It won't work here: I just verified this behaviour on my> test machine. *With* "Require ssl" I get instant (https-)access,> *without* "Require ssl" I'm asked for username / password.Well, according to the Apache docs (https://httpd.apache.org/docs/current/mod/mod_ssl.html#reqssl),one cannot assume that this breaks "Require valid-user". Looks somehowlike a bug in Apache...I think I will just replace the directories with HTTP 301 in theunencrypted file (as I mentioned in the other mail), but for the"ipfire-interface-ssl.conf" file, we can assume SSL is used, anyway.We _can_ assume, but we are not sure. :-|Will use a nightly build tomorrow and develop a better patch.Best regards,Peter Müller> > Best,> Matthias> > > @All: Anybody against or in favor?> > > > Best regards,> > Peter Müller> >   > >> Hello Matthias,> >> > >> tanks for reporting this. I am trying to reproduce here...> >> > >> Best regards,> >> Peter Müller> >>   > >> > Hi Peter,> >> > > >> > Please review this patch... (http://patchwork.ipfire.org/patch/1413/)> >> > > >> > During testing I found that every machine in my GREEN net was suddenly> >> > able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].> >> > > >> > No question for admin-username, no password authentification request,> >> > nothing.> >> > > >> > It seems as as if the Authentication Header is missing(?).> >> > > >> > Only when I remove the "Require ssl" lines (I did this in both files), a> >> > browser restart leads to the usual login procedure.> >> > > >> > Best,> >> > Matthias> >> > > >> > On 08.09.2017 19:19, Peter Müller wrote:    > >> > > Force SSL/TLS for any WebUI directory which requires an authentication.> >> > > This prevents credentials from being transmitted in plaintext, which is> >> > > an information leak.> >> > > > >> > > Scenario: A MITM attacker might block all encrypted traffic to the> >> > > firewall's web interface, making the administrator using an unencrypted> >> > > connection (i.e. via port 81). Username and password can be easily> >> > > logged in transit then.> >> > > > >> > > Signed-off-by: Peter Müller <peter.mueller@link38.eu>> >> > > ---> >> > > diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf b/config/httpd/vhosts.d/ipfire-interface-ssl.conf> >> > > index 6f353962e..5ceaa1f32 100644> >> > > --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf> >> > > +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf> >> > > @@ -24,6 +26,7 @@> >> > >          AuthType Basic> >> > >          AuthUserFile /var/ipfire/auth/users> >> > >          Require user admin> >> > > +        Require ssl> >> > >      </DirectoryMatch>> >> > >      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/> >> > >      <Directory /srv/web/ipfire/cgi-bin>> >> > > @@ -33,6 +36,7 @@> >> > >          AuthType Basic> >> > >          AuthUserFile /var/ipfire/auth/users> >> > >          Require user admin> >> > > +        Require ssl> >> > >          <Files chpasswd.cgi>> >> > >              Require all granted> >> > >          </Files>> >> > > @@ -50,6 +54,7 @@> >> > >          AuthType Basic> >> > >          AuthUserFile /var/ipfire/auth/users> >> > >          Require user dial admin> >> > > +        Require ssl> >> > >      </Directory>> >> > >      <Files ~ "\.(cgi|shtml?)$">> >> > >      SSLOptions +StdEnvVars> >> > > @@ -86,5 +91,6 @@> >> > >          AuthType Basic> >> > >          AuthUserFile /var/ipfire/auth/users> >> > >          Require user admin> >> > > +        Require ssl> >> > >      </Directory>> >> > >  </VirtualHost>> >> > > diff --git a/config/httpd/vhosts.d/ipfire-interface.conf b/config/httpd/vhosts.d/ipfire-interface.conf> >> > > index 619f90fcc..58d1b54cd 100644> >> > > --- a/config/httpd/vhosts.d/ipfire-interface.conf> >> > > +++ b/config/httpd/vhosts.d/ipfire-interface.conf> >> > > @@ -16,6 +16,7 @@> >> > >          AuthType Basic> >> > >          AuthUserFile /var/ipfire/auth/users> >> > >          Require user admin> >> > > +        Require ssl> >> > >      </DirectoryMatch>> >> > >      ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/> >> > >      <Directory /srv/web/ipfire/cgi-bin>> >> > > @@ -25,6 +26,7 @@> >> > >          AuthType Basic> >> > >          AuthUserFile /var/ipfire/auth/users> >> > >          Require user admin> >> > > +        Require ssl> >> > >           <Files chpasswd.cgi>> >> > >              Require all granted> >> > >          </Files>> >> > > @@ -42,6 +44,7 @@> >> > >          AuthType Basic> >> > >          AuthUserFile /var/ipfire/auth/users> >> > >          Require user dial admin> >> > > +        Require ssl> >> > >      </Directory>> >> > >      Alias /updatecache/ /var/updatecache/> >> > >      <Directory /var/updatecache>> >> > >       > >> >     > >>   > > > > > >   >
<HTML><BODY><FONT style='white-space:pre-wrap;font-family: Helvetica Neue, Helvetica, Arial, sans-serif;margin: 1em 0;'><br><br>Sent from IBM Verse</FONT><br><br><div class="domino-section" dir="ltr"><div class="domino-section-head"><span class="domino-section-title"><font color="#424282">Peter Müller --- Re: [PATCH] force transport encryption for WebUI logins --- </font></span></div><div class="domino-section-body"><br><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td width="1%" style="width: 96px;"><font size="2" color="#5F5F5F">From:</font></td><td width="100%" style="width: auto;"><font size="2">&quot;Peter Müller&quot; &lt;peter.mueller@link38.eu&gt;</font></td></tr><tr valign="top"><td width="1%" style="width: 96px;"><font size="2" color="#5F5F5F">To:</font></td><td width="100%" style="width: auto;"><font size="2">&quot;Matthias Fischer&quot; &lt;matthias.fischer@ipfire.org&gt;</font></td></tr><tr valign="top"><td width="1%" style="width: 96px;"><font size="2" color="#5F5F5F">Cc:</font></td><td width="100%" style="width: auto;"><font size="2">development@lists.ipfire.org</font></td></tr><tr valign="top"><td width="1%" style="width: 96px;"><font size="2" color="#5F5F5F">Date:</font></td><td width="100%" style="width: auto;"><font size="2">Sat, Sep 23, 2017 3:08 PM</font></td></tr><tr valign="top"><td width="1%" style="width: 96px;"><font size="2" color="#5F5F5F">Subject:</font></td><td width="100%" style="width: auto;"><font size="2">Re: [PATCH] force transport encryption for WebUI logins</font></td></tr></table><hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br></div><html><body><div style="opacity: 0.87;"><pre style="white-space:pre-wrap;"><font color="#000000">Hello Matthias,<br/><br/>thanks for the quick reply.<br/><br/><!-- -->&gt; On 23.09.2017 20:19, Peter Müller wrote:<br/><!-- -->&gt; <!-- -->&gt; Hello Matthias,<br/><!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt; your described scenario does not appear on my machine. :-( &nbsp;<br/><!-- -->&gt; <br/><!-- -->&gt; Hm... Weird.<br/><!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt; However, the "Require ssl" directive seems not to work with the<br/><!-- -->&gt; <!-- -->&gt; 2.2.x branch, here, we still need the old "SSLRequireSSL". (On<br/><!-- -->&gt; <!-- -->&gt; the other hand, it was intended to be used with the new version.)<br/><!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt; Which version are you running? &nbsp;<br/><!-- -->&gt; <br/><!-- -->&gt; Sorry, forgot. I'm using 2.4.27 from current 'next', built today, on<br/><!-- -->&gt; Core 113.<br/>Ah, I was still at 2.2.x (where the patch has no effect) and tested<br/>against a 2.4.x web server I had at hand.<br/><br/>Promise to test better next time.<br/><!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt; I think the best solution for now is to disregard this patch.<br/><!-- -->&gt; <!-- -->&gt; After the Core Update with 2.4.27 version was released, I'll<br/><!-- -->&gt; <!-- -->&gt; give it another try. &nbsp;<br/><!-- -->&gt; <br/><!-- -->&gt; See above... It won't work here: I just verified this behaviour on my<br/><!-- -->&gt; test machine. *With* "Require ssl" I get instant (https-)access,<br/><!-- -->&gt; *without* "Require ssl" I'm asked for username / password.<br/>Well, according to the Apache docs (https://httpd.apache.org/docs/current/mod/mod_ssl.html#reqssl),<br/>one cannot assume that this breaks "Require valid-user". Looks somehow<br/>like a bug in Apache...<br/><br/>I think I will just replace the directories with HTTP 301 in the<br/>unencrypted file (as I mentioned in the other mail), but for the<br/>"ipfire-interface-ssl.conf" file, we can assume SSL is used, anyway.<br/><br/>We _can_ assume, but we are not sure. :-|<br/><br/>Will use a nightly build tomorrow and develop a better patch.<br/><br/>Best regards,<br/>Peter Müller<br/><br/><br/><!-- -->&gt; <br/><!-- -->&gt; Best,<br/><!-- -->&gt; Matthias<br/><!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt; @All: Anybody against or in favor?<br/><!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt; Best regards,<br/><!-- -->&gt; <!-- -->&gt; Peter Müller<br/><!-- -->&gt; <!-- -->&gt; &nbsp; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; Hello Matthias,<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; tanks for reporting this. I am trying to reproduce here...<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; Best regards,<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; Peter Müller<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; &nbsp; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; Hi Peter,<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; Please review this patch... (http://patchwork.ipfire.org/patch/1413/)<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; During testing I found that every machine in my GREEN net was suddenly<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; No question for admin-username, no password authentification request,<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; nothing.<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; It seems as as if the Authentication Header is missing(?).<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; Only when I remove the "Require ssl" lines (I did this in both files), a<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; browser restart leads to the usual login procedure.<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; Best,<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; Matthias<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; On 08.09.2017 19:19, Peter Müller wrote: &nbsp; &nbsp;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; Force SSL/TLS for any WebUI directory which requires an authentication.<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; This prevents credentials from being transmitted in plaintext, which is<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; an information leak.<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; Scenario: A MITM attacker might block all encrypted traffic to the<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; firewall's web interface, making the administrator using an unencrypted<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; connection (i.e. via port 81). Username and password can be easily<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; logged in transit then.<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; Signed-off-by: Peter Müller <!-- -->&lt;peter.mueller@link38.eu<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; ---<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf b/config/httpd/vhosts.d/ipfire-interface-ssl.conf<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; index 6f353962e..5ceaa1f32 100644<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; @@ -24,6 +26,7 @@<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthType Basic<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthUserFile /var/ipfire/auth/users<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Require user admin<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; + &nbsp; &nbsp; &nbsp; &nbsp;Require ssl<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;<!-- -->&lt;/DirectoryMatch<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;<!-- -->&lt;Directory /srv/web/ipfire/cgi-bin<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; @@ -33,6 +36,7 @@<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthType Basic<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthUserFile /var/ipfire/auth/users<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Require user admin<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; + &nbsp; &nbsp; &nbsp; &nbsp;Require ssl<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<!-- -->&lt;Files chpasswd.cgi<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Require all granted<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<!-- -->&lt;/Files<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; @@ -50,6 +54,7 @@<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthType Basic<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthUserFile /var/ipfire/auth/users<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Require user dial admin<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; + &nbsp; &nbsp; &nbsp; &nbsp;Require ssl<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;<!-- -->&lt;/Directory<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;<!-- -->&lt;Files ~ "\.(cgi|shtml?)$"<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;SSLOptions +StdEnvVars<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; @@ -86,5 +91,6 @@<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthType Basic<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthUserFile /var/ipfire/auth/users<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Require user admin<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; + &nbsp; &nbsp; &nbsp; &nbsp;Require ssl<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;<!-- -->&lt;/Directory<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp;<!-- -->&lt;/VirtualHost<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; diff --git a/config/httpd/vhosts.d/ipfire-interface.conf b/config/httpd/vhosts.d/ipfire-interface.conf<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; index 619f90fcc..58d1b54cd 100644<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; --- a/config/httpd/vhosts.d/ipfire-interface.conf<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; +++ b/config/httpd/vhosts.d/ipfire-interface.conf<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; @@ -16,6 +16,7 @@<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthType Basic<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthUserFile /var/ipfire/auth/users<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Require user admin<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; + &nbsp; &nbsp; &nbsp; &nbsp;Require ssl<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;<!-- -->&lt;/DirectoryMatch<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;<!-- -->&lt;Directory /srv/web/ipfire/cgi-bin<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; @@ -25,6 +26,7 @@<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthType Basic<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthUserFile /var/ipfire/auth/users<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Require user admin<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; + &nbsp; &nbsp; &nbsp; &nbsp;Require ssl<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <!-- -->&lt;Files chpasswd.cgi<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Require all granted<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<!-- -->&lt;/Files<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; @@ -42,6 +44,7 @@<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthType Basic<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AuthUserFile /var/ipfire/auth/users<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Require user dial admin<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; + &nbsp; &nbsp; &nbsp; &nbsp;Require ssl<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;<!-- -->&lt;/Directory<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;Alias /updatecache/ /var/updatecache/<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp;<!-- -->&lt;Directory /var/updatecache<!-- -->&gt;<br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; &nbsp; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; <!-- -->&gt; &nbsp; &nbsp; <br/><!-- -->&gt; <!-- -->&gt;<!-- -->&gt; &nbsp; <br/><!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt; <br/><!-- -->&gt; <!-- -->&gt; &nbsp; <br/><!-- -->&gt; <br/><br/></font></pre></div></body></html></BODY></HTML>
  
Peter Müller Sept. 24, 2017, 5:11 p.m. UTC | #11
Hello,

just sent in a second version of the patch. It should work now.

@Matthias: You were right. The "<RequireAll>" is needed in order
to make both Require-directives mandatory (found here:
https://httpd.apache.org/docs/2.4/howto/auth.html#beyond).

Further, the redirect to the SSL sites are marked with 301
("permanently") so the browsers never forget them. :-)

Patch works here, but please test, too.

Best regards,
Peter Müller

> Hi,
> 
> On Sat, 2017-09-23 at 21:56 +0200, Peter Müller wrote:
> > Hello,
> >   
> > > Hi,
> > > 
> > > On Sat, 2017-09-23 at 15:18 -0400, Tom Rymes wrote:  
> > > > That makes sense to me. One step at a time!
> > > >     
> > > > > On Sep 23, 2017, at 2:19 PM, Peter Müller <peter.mueller@link38.eu> wrote:
> > > > > 
> > > > > Hello Matthias,
> > > > > 
> > > > > your described scenario does not appear on my machine. :-(
> > > > > 
> > > > > However, the "Require ssl" directive seems not to work with the
> > > > > 2.2.x branch, here, we still need the old "SSLRequireSSL". (On
> > > > > the other hand, it was intended to be used with the new version.)
> > > > > 
> > > > > Which version are you running?
> > > > > 
> > > > > I think the best solution for now is to disregard this patch.
> > > > > After the Core Update with 2.4.27 version was released, I'll
> > > > > give it another try.    
> > > 
> > > Well, the update for Apache 2.4 is in next right now.  
> > 
> > Yes, I saw Arne closing Core114 a few hours ago.  
> 
> Oh. :)
> 
> > > 
> > > If there is any doubt on whether SSL is always enforced or not we should
> > > investigate as soon as possible. I don't think that we should wait too much
> > > longer with the entire update any ways, but this certainly delays it.  
> > 
> > SSL enforcement is not the problem here. The problem is to make sure SSL
> > is enforced in case sensitive data (logins, configuration settings, ...) are
> > transmitted.
> > 
> > Enforcing SSL globally on IPFire is not possible AFAIK, since we need some
> > plaintext transfer for Squid error messages, and the update accelerator, and
> > things like that.
> > 
> > At the moment - without the patch I sent in - it is possible to log in
> > to the WebUI without SSL by using port 81.
> > 
> > The patch was intended for Apache 2.4.x, since on 2.2.x, the "Require ssl"
> > is just ignored. On the other hand, "SSLRequireSSL" would work on both
> > versions, but is depreached in 2.4.x.
> > 
> > Since I cannot reproduce the scenario Matthias wrote, I strongly recommend
> > not to apply the patch until this has been clarified. If possible, I will
> > test this in a VDI/Nightly Build image tomorrow.
> > 
> > Besides from that, there are two aspects to discuss in the meantime: :-)
> > (a) Looking at the actual configuration files in "/etc/httpd/conf/vhosts.d/",
> > it might make sense to delete all directory blocks in the "ipfire-interface.conf"
> > which require an authentication and replace them with a HTTP 301 redirect to
> > the SSL location.
> > 
> > That way, even if Apache ignores the whatever-named directive to force
> > SSL, transmitting login data in plaintext is not possible. Thinking
> > about this, I like this idea better than my original one.
> > 
> > Resources without authentication must remain untouched (as mentioned above).  
> 
> Agreed. This is what we should do. Looking back I have no idea why this
> was ever done this way. I remember historically the web if didn't have
> SSL and it was added later, but not all browsers supported it. So HTTP
> was meant to be working as well as HTTPS.
> 
> Since we have had this issue before Apache 2.4, I guess it does not
> make sense to delay the update for it.
> 
> > (b) Although this is a security vulnerability, it is not a very severe one
> > in the default configuration - as far as I am concerned.
> > 
> > It requires a MITM between IPFire and the administrator's computer, and
> > an admin who accesses the unencrypted resource on port 81 every time or
> > in case the MITM blocked encrypted connections to 444.  
> 
> Since we use SSL and nobody can properly validate the certificate, MITM
> is always super easy to do to be honest.
> 
> > Of course, in case anybody created a firewall rule allowing traffic from
> > RED to IPFire's internal port 81 and 444, this issue becomes quite critical.
> > According to Shodan, a lot of people do so.  
> 
> Those misconfigured a lot. They are on their own.
> 
> > To sum it up: We/I should fix this as soon as possible, but in case it
> > needs some more time, it's severity does not require a delay to Core 114
> > as far as I am concerned.  
> 
> See above.
> 
> > I would be happy to get feedback, especially to (a).
> > 
> > Hopefully, I have a working patch ready by tomorrow evening.
> > 
> > Best regards,
> > Peter Müller
> > 
> > @Michael P.S.: What about the other patches (ECDSA, SSL ciphers and all
> > the minor WebUI stuff)? Are they not working, too?  
> 
> No, not yet. Things have been very busy around me and this is solely on
> me.
> 
> >   
> > > 
> > > Best,
> > > -Michael
> > >   
> > > > > 
> > > > > @All: Anybody against or in favor?
> > > > > 
> > > > > Best regards,
> > > > > Peter Müller
> > > > >     
> > > > > > Hello Matthias,
> > > > > > 
> > > > > > tanks for reporting this. I am trying to reproduce here...
> > > > > > 
> > > > > > Best regards,
> > > > > > Peter Müller
> > > > > >     
> > > > > > > Hi Peter,
> > > > > > > 
> > > > > > > Please review this patch... (http://patchwork.ipfire.org/patch/1413/)
> > > > > > > 
> > > > > > > During testing I found that every machine in my GREEN net was suddenly
> > > > > > > able to login through https://[IPFIRE_GREEN_ADDRESS]:[444].
> > > > > > > 
> > > > > > > No question for admin-username, no password authentification request,
> > > > > > > nothing.
> > > > > > > 
> > > > > > > It seems as as if the Authentication Header is missing(?).
> > > > > > > 
> > > > > > > Only when I remove the "Require ssl" lines (I did this in both files), a
> > > > > > > browser restart leads to the usual login procedure.
> > > > > > > 
> > > > > > > Best,
> > > > > > > Matthias
> > > > > > >     
> > > > > > > > On 08.09.2017 19:19, Peter Müller wrote:  
> > > > > > > > Force SSL/TLS for any WebUI directory which requires an
> > > > > > > > authentication.
> > > > > > > > This prevents credentials from being transmitted in plaintext, which
> > > > > > > > is
> > > > > > > > an information leak.
> > > > > > > > 
> > > > > > > > Scenario: A MITM attacker might block all encrypted traffic to the
> > > > > > > > firewall's web interface, making the administrator using an
> > > > > > > > unencrypted
> > > > > > > > connection (i.e. via port 81). Username and password can be easily
> > > > > > > > logged in transit then.
> > > > > > > > 
> > > > > > > > Signed-off-by: Peter Müller <peter.mueller@link38.eu>
> > > > > > > > ---
> > > > > > > > diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > > > b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > > > index 6f353962e..5ceaa1f32 100644
> > > > > > > > --- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > > > +++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
> > > > > > > > @@ -24,6 +26,7 @@
> > > > > > > >         AuthType Basic
> > > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > > >         Require user admin
> > > > > > > > +        Require ssl
> > > > > > > >     </DirectoryMatch>
> > > > > > > >     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> > > > > > > >     <Directory /srv/web/ipfire/cgi-bin>
> > > > > > > > @@ -33,6 +36,7 @@
> > > > > > > >         AuthType Basic
> > > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > > >         Require user admin
> > > > > > > > +        Require ssl
> > > > > > > >         <Files chpasswd.cgi>
> > > > > > > >             Require all granted
> > > > > > > >         </Files>
> > > > > > > > @@ -50,6 +54,7 @@
> > > > > > > >         AuthType Basic
> > > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > > >         Require user dial admin
> > > > > > > > +        Require ssl
> > > > > > > >     </Directory>
> > > > > > > >     <Files ~ "\.(cgi|shtml?)$">
> > > > > > > >    SSLOptions +StdEnvVars
> > > > > > > > @@ -86,5 +91,6 @@
> > > > > > > >         AuthType Basic
> > > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > > >         Require user admin
> > > > > > > > +        Require ssl
> > > > > > > >     </Directory>
> > > > > > > > </VirtualHost>
> > > > > > > > diff --git a/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > > > b/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > > > index 619f90fcc..58d1b54cd 100644
> > > > > > > > --- a/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > > > +++ b/config/httpd/vhosts.d/ipfire-interface.conf
> > > > > > > > @@ -16,6 +16,7 @@
> > > > > > > >         AuthType Basic
> > > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > > >         Require user admin
> > > > > > > > +        Require ssl
> > > > > > > >     </DirectoryMatch>
> > > > > > > >     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
> > > > > > > >     <Directory /srv/web/ipfire/cgi-bin>
> > > > > > > > @@ -25,6 +26,7 @@
> > > > > > > >         AuthType Basic
> > > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > > >         Require user admin
> > > > > > > > +        Require ssl
> > > > > > > >          <Files chpasswd.cgi>
> > > > > > > >             Require all granted
> > > > > > > >         </Files>
> > > > > > > > @@ -42,6 +44,7 @@
> > > > > > > >         AuthType Basic
> > > > > > > >         AuthUserFile /var/ipfire/auth/users
> > > > > > > >         Require user dial admin
> > > > > > > > +        Require ssl
> > > > > > > >     </Directory>
> > > > > > > >     Alias /updatecache/ /var/updatecache/
> > > > > > > >    <Directory /var/updatecache>
> > > > > > > >     
> > > > > 
> > > > >     
> > 
> >
  

Patch

diff --git a/config/httpd/vhosts.d/ipfire-interface-ssl.conf b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
index 6f353962e..5ceaa1f32 100644
--- a/config/httpd/vhosts.d/ipfire-interface-ssl.conf
+++ b/config/httpd/vhosts.d/ipfire-interface-ssl.conf
@@ -24,6 +26,7 @@ 
         AuthType Basic
         AuthUserFile /var/ipfire/auth/users
         Require user admin
+        Require ssl
     </DirectoryMatch>
     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
     <Directory /srv/web/ipfire/cgi-bin>
@@ -33,6 +36,7 @@ 
         AuthType Basic
         AuthUserFile /var/ipfire/auth/users
         Require user admin
+        Require ssl
         <Files chpasswd.cgi>
             Require all granted
         </Files>
@@ -50,6 +54,7 @@ 
         AuthType Basic
         AuthUserFile /var/ipfire/auth/users
         Require user dial admin
+        Require ssl
     </Directory>
     <Files ~ "\.(cgi|shtml?)$">
 	SSLOptions +StdEnvVars
@@ -86,5 +91,6 @@ 
         AuthType Basic
         AuthUserFile /var/ipfire/auth/users
         Require user admin
+        Require ssl
     </Directory>
 </VirtualHost>
diff --git a/config/httpd/vhosts.d/ipfire-interface.conf b/config/httpd/vhosts.d/ipfire-interface.conf
index 619f90fcc..58d1b54cd 100644
--- a/config/httpd/vhosts.d/ipfire-interface.conf
+++ b/config/httpd/vhosts.d/ipfire-interface.conf
@@ -16,6 +16,7 @@ 
         AuthType Basic
         AuthUserFile /var/ipfire/auth/users
         Require user admin
+        Require ssl
     </DirectoryMatch>
     ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/
     <Directory /srv/web/ipfire/cgi-bin>
@@ -25,6 +26,7 @@ 
         AuthType Basic
         AuthUserFile /var/ipfire/auth/users
         Require user admin
+        Require ssl
          <Files chpasswd.cgi>
             Require all granted
         </Files>
@@ -42,6 +44,7 @@ 
         AuthType Basic
         AuthUserFile /var/ipfire/auth/users
         Require user dial admin
+        Require ssl
     </Directory>
     Alias /updatecache/ /var/updatecache/
 	<Directory /var/updatecache>