Re: svn commit: r1904269 - in /httpd/httpd/trunk: changes-entries/ docs/manual/mod/ modules/http2/ test/modules/http2/

2022-10-18 Thread Roy T. Fielding
> On Oct 6, 2022, at 2:17 AM, Stefan Eissing via dev  
> wrote:
> 
>> Am 05.10.2022 um 19:34 schrieb Stefan Eissing via dev :
>> 
>> 
>> 
>>> Am 05.10.2022 um 18:48 schrieb Eric Covener :
>>> 
>>> On Wed, Oct 5, 2022 at 12:44 PM Roy T. Fielding  wrote:
 
> On Sep 26, 2022, at 5:29 AM, ic...@apache.org wrote:
> 
> Author: icing
> Date: Mon Sep 26 12:29:47 2022
> New Revision: 1904269
> 
> URL: http://svn.apache.org/viewvc?rev=1904269=rev
> Log:
> *) mod_http2: new directive "H2HeaderStrictness" to control the compliance
>  level of header checks as defined in the HTTP/2 RFCs. Default is 7540.
>  9113 activates the checks for forbidden leading/trailing whitespace in
>  field values (available from nghttp2 v1.50.0 on).
 
 I am not seeing why that should be optional. It adds overhead, but it 
 reduces
 variability (for HPACK) and might prevent some downstream vulnerabilities, 
 IIRC.
 Maybe an internal switch for testing with default on?
> 
> To add some more detail:
> 
> - rfc9113 ch 8.2.1 states: "A field value MUST NOT start or end with an ASCII 
> whitespace character"
> - nghttp2 v1.49.0 implemented that check, non-optional. Things broke.
> - nghttp2 v1.50.0 added to its API so that the application can control the 
> behaviour on request of Daniel Stenberg
> - I added "H2HeaderStrictness" (in trunk only for now) to steer that.
> 
> This is not a normalization issue, it's a hard "MUST NOT" e.g. rejection of 
> the request/response carrying such a field. While I agree that there are many 
> advantages in having fields more strict, the way to get there is not clear.
> 
> I am totally in favour of avoiding "H2HeaderStrictness", but just enforcing 
> rfc9113 here will not do. What would our response be for people whose legacy 
> clients/fronted applications will no longer work?

Well, normally, I don't have a problem with just breaking them.
They are broken. Someone can fix them.

It isn't a normalization issue. Whitespace that magically appeared when h2
changed the framing of header field values immediately became a security
vulnerability for all downstream recipients of h2/h3 messages that use
generic HTTP (semantic) field values expecting that stuff to have
been excluded during parsing.

IOW, it's a security hole and our code either fixes it or gets a CVE.
We MUST NOT forward the malformed data in fields. That is not an option.

OTOH, how we deal with a request containing malformed data in fields
(after making it well-formed) is a SHOULD send 400, not a MUST.
If we want to be super nice to the folks shipping bad code (or running pen
testers) and have an option to strip the naughty bits out while forwarding
the message, that's fine with me as an optional directive. But that won't
help them interop with the rest of the Internet.

Cheers,

Roy



Re: svn commit: r1904638 - in /httpd/httpd/trunk: changes-entries/DAVLockDiscovery.txt modules/dav/main/mod_dav.c modules/dav/main/mod_dav.h modules/dav/main/props.c

2022-10-18 Thread Emmanuel Dreyfus
On Mon, Oct 17, 2022 at 12:04:55PM +0200, Ruediger Pluem wrote:
> Why do we need to use an Apache expression here? Wouldn't it be sufficient to 
> have
> DAVLockDiscovery as a flag (On/Off) with default to On that can be placed in 
> an
>  block if expressions are needed?

Yes, that would be fine too. I was too focused on a specific client's client
behavior that expr on User-Agent and remote IP seemed  critical to me,
but indeed  acheive the same result.



-- 
Emmanuel Dreyfus
m...@netbsd.org


Re: svn commit: r1904638 - in /httpd/httpd/trunk: changes-entries/DAVLockDiscovery.txt modules/dav/main/mod_dav.c modules/dav/main/mod_dav.h modules/dav/main/props.c

2022-10-18 Thread Emmanuel Dreyfus
On Mon, Oct 17, 2022 at 05:38:37AM -0500, Greg Stein wrote:
> Did you run any tests to observe the alleged contention?

I was the victim of it, with a server showing processes awaiting
for fcntl() to give a lock on DAVLockDB, and users complaining
anything takes ages.

> The dbm database is very fast. I'd be surprised that contention occurs in
> any typical workload.

dbm is fast once you have it open. mod_dav_fs opens DAVLockDB on each 
HTTP request, then it acquire a filesystem level lock on it. This is 
where contenton occurs.


-- 
Emmanuel Dreyfus
m...@netbsd.org