Bug 1248519

Summary: python-smbc: auth_fn hardening
Product: Red Hat Enterprise Linux 7 Reporter: Florian Weimer <fweimer>
Component: python-smbcAssignee: Charalampos Stratakis <cstratak>
Status: CLOSED ERRATA QA Contact: Mirek Długosz <mzalewsk>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: bnater, cstratak, fweimer, hhorak, isenfeld, jkejda, mzalewsk, pviktori, python-maint, torsava
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-smbc-1.0.13-8.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 15:54:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1223392, 1465891    

Description Florian Weimer 2015-07-30 12:53:03 UTC
This code in context.c does not cause the output strings to be NUL-terminated if they exceed the specified length:

  strncpy (workgroup, use_workgroup, wgmaxlen);
  strncpy (username, use_username, unmaxlen);
  strncpy (password, use_password, pwmaxlen);

This could lead to crashes inside libsmbclient.

Upstream bug: https://fedorahosted.org/pysmbc/ticket/6

Comment 3 Charalampos Stratakis 2017-04-24 13:19:03 UTC
Upstream has changed to https://github.com/hamano/pysmbc

Bug fix:
https://github.com/hamano/pysmbc/commit/94a8572b78f9734e0f37e5ffc8a61926101a3d77

Comment 4 Petr Viktorin (pviktori) 2017-10-05 14:02:28 UTC
Engineering-wise, applying the fix is not a problem.

Comment 7 Charalampos Stratakis 2017-10-24 14:47:24 UTC
Florian would you happen to have some sort of reproducer so QE can verify the fix?

Since fedorahosted is retired now, the original bug report is lost.

Comment 8 Florian Weimer 2017-10-24 17:49:35 UTC
(In reply to Charalampos Stratakis from comment #7)
> Florian would you happen to have some sort of reproducer so QE can verify
> the fix?
> 
> Since fedorahosted is retired now, the original bug report is lost.

The relevant commit is now at:

https://github.com/hamano/pysmbc/commit/94a8572b78f9734e0f37e5ffc8a61926101a3d77

The fedorahosted ticket did not contain additional information.  I think it is sufficient if you verify that the patch has been applied.

Comment 13 errata-xmlrpc 2018-04-10 15:54:35 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0873