Skip to content

Wrong HTTP response code in logback-access logs #8148

@baranchikovaleks

Description

@baranchikovaleks

Jetty version - 9.4.46.v20220331

Java version - openjdk version "11.0.11" 2021-04-20

OS - Ubuntu 18.04

Hello!

We spotted in our production access logs some malicious requests that resulted in 200 response code. Further investigation showed that actual HTTP response code is 400, but for some reason 200 OK apprears in access logs.

I created a small project to reproduce, see https://github.com/baranchikovaleks/jettyAccessLog

The request I send is

curl -i http://localhost:8180/cgi-bin/.%2e/.%2e/.%2e/.%2e/bin/sh -d 'echo;id'
HTTP/1.1 400 Bad Request
Content-Type: text/html;charset=iso-8859-1
Content-Length: 54
Connection: close
Server: Jetty(9.4.46.v20220331)

<h1>Bad Message 400</h1><pre>reason: Bad Request</pre>

As I can see, using CURL I got 400 Bad request, while access logs says

127.0.0.1 - - [09/Jun/2022:11:12:24 +0300] "POST /cgi-bin/.%2e/.%2e/.%2e/.%2e/bin/sh null" 200 0 "-" "-"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Third PartyIssues with third party libraries or projects

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions