Bug 530950 - Stunnel is limiting protocol STARTTLS handshake strings to 256 characters only
Summary: Stunnel is limiting protocol STARTTLS handshake strings to 256 characters only
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: stunnel
Version: 19
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Avesh Agarwal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-26 09:26 UTC by Andrej Ota
Modified: 2019-12-05 13:57 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-14 18:01:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch to make static STRELN buffers 1024 bytes long (474 bytes, patch)
2009-10-26 09:26 UTC, Andrej Ota
no flags Details | Diff

Description Andrej Ota 2009-10-26 09:26:10 UTC
Created attachment 366078 [details]
Patch to make static STRELN buffers 1024 bytes long

Description of problem:
When using protocol parameter to support STARTTLS handshake for IMAP protocol, the maximum line length that backend server can send must not exceed 255 characters. This causes problems when using IMAP server which has capabilities line longer than this limit.

When stunnel encounters such line, it closes the connection on both ends.

I have only tested for IMAP, it is possible that SMTP and POP3 protocols are affected as well.


Version-Release number of selected component (if applicable):
4.28 and older versions are affected.


How reproducible:
It fails whenever capabilities line length exceeds 255 characters.


Steps to Reproduce:
1. Set up stunnel to act as a STARTTLS proxy to IMAP server with long capabilities line.
2. Connect to stunnel and send capability IMAP command.

  
Actual results:
Stunnel disconnects the session instead of handling long capapbilities line.


Expected results:
Stunnel should handle long capabilities line.


Additional info:
Problem is in code which is using static buffers to receive and process this data. This causes problems as it means that setting can not be changed via configuration, but only with recompile.

Workaround solution (attached patch file) is to enlarge the buffer using STRLEN macro which defines the length of this buffer. While 1024 bytes still presents a limit, it should be enough for most current uses and still small enough not to consume too much stack.

Better solution would require rewriting whole sections of code to make this precompiler macro a configurable value.

Comment 1 Bug Zapper 2010-04-28 10:58:20 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 2 Andrej Ota 2010-05-01 03:16:43 UTC
Yes, this is still very much alive and causing a lot of troubles in split frontend-backend setups.

Not everybody wants to run IMAP on public server and have storage mapped through NFS or similar network protocol.

Comment 3 Bug Zapper 2010-11-04 09:07:21 UTC
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Fedora End Of Life 2013-04-03 18:28:06 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 5 Avesh Agarwal 2014-07-14 18:01:40 UTC
This bz is tested in latest upstream release 5.02 and seems to work. STRLEN has been no longer allocated statically since 4.36 version. So it is possible that this bz might have got fixed around 4.36 release.

If you encounter this issue again, please reopen this bz.


Note You need to log in before you can comment on or make changes to this bug.