AUTH_FILE option uses incorrect line ending in HTTP request

Bug #1697507 reported by Matt Summers
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
corkscrew (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Background:

Using the AUTH_FILE option reads the provided file and uses it to add the "Proxy-Authorization" header to the request made to the proxy.

corkscrew.c:231
        if ((argc == 6) || (argc == 7)) {
                strncat(uri, "\nProxy-Authorization: Basic ", sizeof(uri) - strlen(uri) - 1);
                strncat(uri, base64_encode(up), sizeof(uri) - strlen(uri) - 1);
        }

This uses an invalid newline for an HTTP request. \n is used, should be \r\n.

What happens:

When used with apache as a forward proxy, for example, this causes a 400 error to be returned from the server. Using nc and crafting a request to use \r\n instead, this works.

What I expect to happen:

The proxy request takes place.

Environment:

Description: Ubuntu 16.04.2 LTS
Release: 16.04

ii corkscrew 2.0-10 amd64 tunnel TCP connections through HTTP proxies

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in corkscrew (Ubuntu):
status: New → Confirmed
Revision history for this message
Serge (sdolgikh21) wrote :

I can confirm this bug, using apache as a forward proxy too and getting 400 error. Manual patching this line eliminated the problem.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package corkscrew - 2.0-13

---------------
corkscrew (2.0-13) unstable; urgency=medium

  * debian/patches:
    - Refresh patches.
    - Add patch 05 to handle AUTH_FILE option using incorrect line
      ending in HTTP request (LP: #1697507).
  * Add lintian-overrides to silence patch-not-forwarded-upstream
    warning.

 -- Roger Shimizu <email address hidden> Sun, 27 Dec 2020 22:38:51 +0900

Changed in corkscrew (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.