Page MenuHome GnuPG
Feed Advanced Search

May 3 2016

werner added a comment to T2344: out of bounds read in ksba_cert_get_ext_key_usages called from libksba/cert-basic.

I just released 1.3.4 and thus closing this bug and 2342 and 2343. Thanks again
for you help.

May 3 2016, 6:38 PM · Bug Report, libksba
werner closed T2344: out of bounds read in ksba_cert_get_ext_key_usages called from libksba/cert-basic as Resolved.
May 3 2016, 6:38 PM · Bug Report, libksba
werner removed a project from T2344: out of bounds read in ksba_cert_get_ext_key_usages called from libksba/cert-basic: Restricted Project.
May 3 2016, 6:38 PM · Bug Report, libksba
werner added a comment to T2343: Function ksba_cert_get_digest_algo returns an uninitialized pointer in some error cases.

Fixed with commit 3f74c2c. Thanks.

The use in cert-basic is correct because get_oid_desc accepst a NULL pointer.
However, some libc versions bail out on a NULL for "%s"; I fixed that too.

May 3 2016, 4:14 PM · Bug Report, libksba
werner added a project to T2343: Function ksba_cert_get_digest_algo returns an uninitialized pointer in some error cases: Restricted Project.
May 3 2016, 4:14 PM · Bug Report, libksba
werner added a project to T2342: reading uninitialized memory in libksba/cert-basic, with subsequent crash: Restricted Project.
May 3 2016, 4:12 PM · Bug Report, libksba
werner added a comment to T2342: reading uninitialized memory in libksba/cert-basic, with subsequent crash.

Fixed with commit 6be61da.

The old fix for the problem from April 2015 had an off-by-one in the
bad encoding handling. Now using simpler code.

May 3 2016, 4:12 PM · Bug Report, libksba
werner added a comment to T2344: out of bounds read in ksba_cert_get_ext_key_usages called from libksba/cert-basic.

Fixed with commit a7eed17 . Thanks.

I also checked all other places to ensure that the tag length returned from
_ksba_ber_parse_tl is within the bounds.

May 3 2016, 4:10 PM · Bug Report, libksba
werner added a project to T2344: out of bounds read in ksba_cert_get_ext_key_usages called from libksba/cert-basic: Restricted Project.
May 3 2016, 4:10 PM · Bug Report, libksba
werner claimed T2342: reading uninitialized memory in libksba/cert-basic, with subsequent crash.
May 3 2016, 2:20 PM · Bug Report, libksba
werner claimed T2344: out of bounds read in ksba_cert_get_ext_key_usages called from libksba/cert-basic.
May 3 2016, 2:10 PM · Bug Report, libksba

May 1 2016

pascal_cuoq added a comment to T2344: out of bounds read in ksba_cert_get_ext_key_usages called from libksba/cert-basic.

The file oid_oob_big.crt would cause the function ksba_oid_to_str() to be called with a “length” argument of

  1. This is what execution in tis-interpreter (in which allocations always succeed) shows:


48

83

A5

this is not going to end well: length=3100166514561975041

src/oid.c:105:[kernel] warning: out of bounds read. assert \valid_read(buf_0+n);

                  stack: _ksba_oid_to_str :: src/cert.c:1462 <-
                         _ksba_cert_get_ext_key_usages :: src/visibility.c:259 <-
                         ksba_cert_get_ext_key_usages :: tests/cert-basic.c:265 <-
                         list_extensions :: tests/cert-basic.c:545 <-
                         one_file :: tests/cert-basic.c:592 <-
                         main

“Fortunately”, for the file oid_oob_big.crt, execution of the program tests/cert-basic differs in that a memory
allocation fails:

$ ./tests/cert-basic ../../libksba-1.3.3/oid_oob_big.crt
Certificate in `../../libksba-1.3.3/oid_oob_big.crt':

serial....: (#04#)
issuer....: `1.2.840.113549.1.9.1=#696E73656375726540746573742E696E736563757265,CN=For Tests

Only,O=InsecureTestCertificate,C=de'

       aka: `<insecure@test.insecure>'
subject...: `1.2.840.113549.1.9.1=#696E73656375726540746573742E696E736563757265,CN=Insecure Server

Cert,O=InsecureTestCertificate,C=de'

       aka: `<insecure@test.insecure>'
notBefore.: 2001-08-17 08:46:24
notAfter..: 2006-08-16 08:46:24
hash algo.: 1.2.840.113549.1.1.4

Extn: 2.5.29.15 at 474 with length 4
Extn: 2.5.29.37 at 487 with length 12
Extn: 2.5.29.14 at 508 with length 22
Extn: 2.5.29.35 at 541 with length 145
Extn: 2.5.29.17 at 695 with length 26
Extn: 2.5.29.18 at 730 with length 26
Extn: 2.16.840.1.113730.1.1 at 771 with length 4
Extn: 2.16.840.1.113730.1.13 at 790 with length 47
SubjectKeyIdentifier: (#0234E2C906F6E0B44253BE04C0CBA7823A6DB509#)
AuthorityKeyIdentifier: 1.2.840.113549.1.9.1=#696E73656375726540746573742E696E736563757265,CN=For Tests
Only,O=InsecureTestCertificate,C=de

       serial: (#00#)
keyIdentifier: (#BF53438278D09EC380E51B67CA0500DFB94883A5#)

KeyUsage: digitalSignature keyEncipherment keyAgreement
cert-basic.c:271: ksba_cert_ext_key_usages failed: Cannot allocate memory
CertificatePolicies: none

Regardless, between themselves, the two files oid_oob_big.crt and oid_oob_small.crt shows that an attacker seems to have
many possibilities for crafting a malicious certificate that crashes in ksba_oid_to_str() called from
ksba_cert_get_ext_key_usages().

May 1 2016, 1:17 PM · Bug Report, libksba
pascal_cuoq added a comment to T2344: out of bounds read in ksba_cert_get_ext_key_usages called from libksba/cert-basic.

May 1 2016, 1:08 PM · Bug Report, libksba
pascal_cuoq added a comment to T2344: out of bounds read in ksba_cert_get_ext_key_usages called from libksba/cert-basic.

May 1 2016, 1:07 PM · Bug Report, libksba
pascal_cuoq added projects to T2344: out of bounds read in ksba_cert_get_ext_key_usages called from libksba/cert-basic: libksba, Bug Report.
May 1 2016, 1:07 PM · Bug Report, libksba
pascal_cuoq set Version to 1.3.3 on T2344: out of bounds read in ksba_cert_get_ext_key_usages called from libksba/cert-basic.
May 1 2016, 1:07 PM · Bug Report, libksba

Apr 29 2016

pascal_cuoq added projects to T2343: Function ksba_cert_get_digest_algo returns an uninitialized pointer in some error cases: libksba, Bug Report.
Apr 29 2016, 11:10 PM · Bug Report, libksba
pascal_cuoq set Version to 1.3.3 on T2342: reading uninitialized memory in libksba/cert-basic, with subsequent crash.
Apr 29 2016, 7:57 PM · Bug Report, libksba
pascal_cuoq added projects to T2342: reading uninitialized memory in libksba/cert-basic, with subsequent crash: libksba, Bug Report.
Apr 29 2016, 7:57 PM · Bug Report, libksba

Apr 10 2015

werner closed T1467: libksba's configure script reports "--with-libgpg-error-prefix", expects "--with-gpg-error-prefix" as Resolved.
Apr 10 2015, 3:36 PM · Bug Report, libksba
werner added a comment to T1467: libksba's configure script reports "--with-libgpg-error-prefix", expects "--with-gpg-error-prefix".

This has been fixed in libgpg-error and the gpg-error.m4 macros have been
updated in all gnupg related libraries.

Apr 10 2015, 3:36 PM · Bug Report, libksba

Mar 10 2015

werner added a comment to T1880: warning: implicit declaration of function.

No c+p of warnings please! Use gnupg-devel instead.

Mar 10 2015, 9:48 AM · Not A Bug, Bug Report, libksba
werner added a project to T1880: warning: implicit declaration of function: Not A Bug.
Mar 10 2015, 9:48 AM · Not A Bug, Bug Report, libksba
werner closed T1880: warning: implicit declaration of function as Resolved.
Mar 10 2015, 9:48 AM · Not A Bug, Bug Report, libksba
werner added a project to T1876: Memory leaks when running `make check` under Clang sanitizers: Mistaken.
Mar 10 2015, 9:46 AM · Mistaken, Bug Report, libksba
werner closed T1876: Memory leaks when running `make check` under Clang sanitizers as Resolved.
Mar 10 2015, 9:46 AM · Mistaken, Bug Report, libksba
werner added a comment to T1876: Memory leaks when running `make check` under Clang sanitizers.

Use gnupg-devel for such things.

Mar 10 2015, 9:46 AM · Mistaken, Bug Report, libksba
werner closed T1867: Potential use of uniinitialized vairaible as Resolved.
Mar 10 2015, 9:45 AM · Mistaken, Bug Report, libksba
werner added a comment to T1867: Potential use of uniinitialized vairaible.

(If you want to provide a fix, please provide a diff and not the complete file.)

Mar 10 2015, 9:45 AM · Mistaken, Bug Report, libksba
werner reopened T1867: Potential use of uniinitialized vairaible as "Open".
Mar 10 2015, 9:45 AM · Mistaken, Bug Report, libksba
werner closed T1867: Potential use of uniinitialized vairaible as Resolved.
Mar 10 2015, 9:44 AM · Mistaken, Bug Report, libksba
werner added a comment to T1867: Potential use of uniinitialized vairaible.

No c+p of warnings please! Use gnupg-devel for such things.

Mar 10 2015, 9:44 AM · Mistaken, Bug Report, libksba
werner added a project to T1867: Potential use of uniinitialized vairaible: Mistaken.
Mar 10 2015, 9:44 AM · Mistaken, Bug Report, libksba
werner closed T1892: dn.c: function call argument is an uninitialized value as Resolved.
Mar 10 2015, 9:36 AM · Mistaken, Bug Report, libksba
werner added a project to T1892: dn.c: function call argument is an uninitialized value: Mistaken.
Mar 10 2015, 9:36 AM · Mistaken, Bug Report, libksba
werner added a comment to T1892: dn.c: function call argument is an uninitialized value.

No c+p of warnings please! Use gnupg-devel for such things.

Mar 10 2015, 9:36 AM · Mistaken, Bug Report, libksba
werner added a project to T1891: name.c: dereference of null pointer: Mistaken.
Mar 10 2015, 9:35 AM · Mistaken, Bug Report, libksba
werner closed T1891: name.c: dereference of null pointer as Resolved.
Mar 10 2015, 9:35 AM · Mistaken, Bug Report, libksba
werner added a comment to T1891: name.c: dereference of null pointer.

No c+p of warnings please! Use gnupg-devel for such things.

Mar 10 2015, 9:35 AM · Mistaken, Bug Report, libksba
werner closed T1890: ocsp.c: dereference of null pointer as Resolved.
Mar 10 2015, 9:35 AM · Mistaken, Bug Report, libksba
werner added a project to T1890: ocsp.c: dereference of null pointer: Mistaken.
Mar 10 2015, 9:35 AM · Mistaken, Bug Report, libksba
werner added a comment to T1890: ocsp.c: dereference of null pointer.

No c+p of warnings please! Use gnupg-devel for such things.

Mar 10 2015, 9:35 AM · Mistaken, Bug Report, libksba
werner closed T1889: ocsp.c: null pointer passed as an argument to a 'nonnull' parameter as Resolved.
Mar 10 2015, 9:35 AM · Mistaken, Bug Report, libksba
werner added a project to T1889: ocsp.c: null pointer passed as an argument to a 'nonnull' parameter: Mistaken.
Mar 10 2015, 9:35 AM · Mistaken, Bug Report, libksba
werner added a comment to T1889: ocsp.c: null pointer passed as an argument to a 'nonnull' parameter.

No c+p of warnings please! Use gnupg-devel for such things.

Mar 10 2015, 9:35 AM · Mistaken, Bug Report, libksba
werner added a comment to T1888: der-encoder.c: dereference of null pointer.

No c+p of warnings please! Use gnupg-devel for such things.

Mar 10 2015, 9:34 AM · Mistaken, Bug Report, libksba
werner added a project to T1888: der-encoder.c: dereference of null pointer: Mistaken.
Mar 10 2015, 9:34 AM · Mistaken, Bug Report, libksba
werner closed T1888: der-encoder.c: dereference of null pointer as Resolved.
Mar 10 2015, 9:34 AM · Mistaken, Bug Report, libksba

Mar 6 2015

JW renamed T1888: der-encoder.c: dereference of null pointer from Dereference of a null pointer to der-encoder.c: dereference of null pointer.
Mar 6 2015, 8:36 AM · Mistaken, Bug Report, libksba
JW renamed T1889: ocsp.c: null pointer passed as an argument to a 'nonnull' parameter from Null pointer passed as an argument to a 'nonnull' parameter to ocsp.c: null pointer passed as an argument to a 'nonnull' parameter.
Mar 6 2015, 8:35 AM · Mistaken, Bug Report, libksba
JW renamed T1890: ocsp.c: dereference of null pointer from Dereference of a null pointer to ocsp.c: dereference of null pointer.
Mar 6 2015, 8:35 AM · Mistaken, Bug Report, libksba
JW renamed T1891: name.c: dereference of null pointer from Dereference of null pointer to name.c: dereference of null pointer.
Mar 6 2015, 8:35 AM · Mistaken, Bug Report, libksba
JW renamed T1892: dn.c: function call argument is an uninitialized value from Function call argument is an uninitialized value to dn.c: function call argument is an uninitialized value.
Mar 6 2015, 8:34 AM · Mistaken, Bug Report, libksba
JW added projects to T1892: dn.c: function call argument is an uninitialized value: libksba, Bug Report.
Mar 6 2015, 7:54 AM · Mistaken, Bug Report, libksba
JW set Version to 1.3.2 on T1891: name.c: dereference of null pointer.
Mar 6 2015, 7:53 AM · Mistaken, Bug Report, libksba
JW added projects to T1891: name.c: dereference of null pointer: libksba, Bug Report.
Mar 6 2015, 7:53 AM · Mistaken, Bug Report, libksba
JW added projects to T1890: ocsp.c: dereference of null pointer: libksba, Bug Report.
Mar 6 2015, 7:52 AM · Mistaken, Bug Report, libksba
JW set Version to 1.3.2 on T1889: ocsp.c: null pointer passed as an argument to a 'nonnull' parameter.
Mar 6 2015, 7:51 AM · Mistaken, Bug Report, libksba
JW added projects to T1889: ocsp.c: null pointer passed as an argument to a 'nonnull' parameter: libksba, Bug Report.
Mar 6 2015, 7:51 AM · Mistaken, Bug Report, libksba
JW set Version to 1.3.2 on T1888: der-encoder.c: dereference of null pointer.
Mar 6 2015, 7:49 AM · Mistaken, Bug Report, libksba
JW added projects to T1888: der-encoder.c: dereference of null pointer: libksba, Bug Report.
Mar 6 2015, 7:49 AM · Mistaken, Bug Report, libksba
JW added a comment to T1867: Potential use of uniinitialized vairaible.

Changed status to 'unread'. I'm not chatting.

Mar 6 2015, 6:17 AM · Mistaken, Bug Report, libksba
JW added a comment to T1867: Potential use of uniinitialized vairaible.

Updated cert.c which initializes the variable algo.

Mar 6 2015, 6:16 AM · Mistaken, Bug Report, libksba
JW added a comment to T1867: Potential use of uniinitialized vairaible.

Mar 6 2015, 6:16 AM · Mistaken, Bug Report, libksba
JW added a comment to T1876: Memory leaks when running `make check` under Clang sanitizers.

Updated status to 'unread'. I'm not chatting.

Mar 6 2015, 5:16 AM · Mistaken, Bug Report, libksba
JW reopened T1876: Memory leaks when running `make check` under Clang sanitizers as "Open".
Mar 6 2015, 5:16 AM · Mistaken, Bug Report, libksba
JW closed T1876: Memory leaks when running `make check` under Clang sanitizers as Resolved.
Mar 6 2015, 5:15 AM · Mistaken, Bug Report, libksba
JW added a comment to T1876: Memory leaks when running `make check` under Clang sanitizers.

Updated to include line numbers.

54400==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 240 byte(s) in 12 object(s) allocated from:

#0 0x49f45b in __interceptor_malloc

/home/gpg-user/Clang-3.5/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:40:3

#1 0x5462d0 in _ksba_oid_to_str

/home/gpg-user/gcrypt-2.0-sanitize/libksba-1.3.2/src/oid.c:75:16

#2 0x4bcce9 in main

/home/gpg-user/gcrypt-2.0-sanitize/libksba-1.3.2/tests/t-oid.c:164:7

#3 0x2b8edcf1aec4 in __libc_start_main

/build/buildd/eglibc-2.19/csu/libc-start.c:287

Direct leak of 58 byte(s) in 2 object(s) allocated from:

#0 0x49f45b in __interceptor_malloc

/home/gpg-user/Clang-3.5/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:40:3

#1 0x5570e4 in _ksba_strdup

/home/gpg-user/gcrypt-2.0-sanitize/libksba-1.3.2/src/util.c:162:13

#2 0x4bcce9 in main

/home/gpg-user/gcrypt-2.0-sanitize/libksba-1.3.2/tests/t-oid.c:164:7

#3 0x2b8edcf1aec4 in __libc_start_main

/build/buildd/eglibc-2.19/csu/libc-start.c:287

SUMMARY: AddressSanitizer: 298 byte(s) leaked in 14 allocation(s).

FAIL: t-oid

1 of 4 tests failed

Please report to http://bugs.gnupg.org

Mar 6 2015, 5:15 AM · Mistaken, Bug Report, libksba
JW added projects to T1880: warning: implicit declaration of function: libksba, Bug Report.
Mar 6 2015, 5:11 AM · Not A Bug, Bug Report, libksba
JW set Version to 1.3.2 on T1880: warning: implicit declaration of function.
Mar 6 2015, 5:11 AM · Not A Bug, Bug Report, libksba
JW added a comment to T1876: Memory leaks when running `make check` under Clang sanitizers.

Attached is the script I am using to acceptance test the suite. It requires
Clang 3.5 (Clang 3.5 recipe was provided with Bug 1872).

Mar 6 2015, 4:55 AM · Mistaken, Bug Report, libksba
JW added a comment to T1876: Memory leaks when running `make check` under Clang sanitizers.

Mar 6 2015, 4:55 AM · Mistaken, Bug Report, libksba
JW set Version to 1.3.2 on T1876: Memory leaks when running `make check` under Clang sanitizers.
Mar 6 2015, 2:12 AM · Mistaken, Bug Report, libksba
JW added projects to T1876: Memory leaks when running `make check` under Clang sanitizers: libksba, Bug Report.
Mar 6 2015, 2:12 AM · Mistaken, Bug Report, libksba
JW added a comment to T1876: Memory leaks when running `make check` under Clang sanitizers.

Mar 6 2015, 2:12 AM · Mistaken, Bug Report, libksba

Mar 5 2015

JW added projects to T1867: Potential use of uniinitialized vairaible: libksba, Bug Report.
Mar 5 2015, 10:57 PM · Mistaken, Bug Report, libksba

Nov 27 2014

werner closed T1771: Failing test t-oid on Solaris 10 Sparc as Resolved.
Nov 27 2014, 12:25 PM · Bug Report, libksba

Nov 25 2014

dagobert added a comment to T1771: Failing test t-oid on Solaris 10 Sparc.

Ah yes, I had that before in our build system where RUNPATH is passed via LD_OPTIONS.
If I pass the flags via LDFLAGS it works.

Thanks! -- Dago

Nov 25 2014, 10:06 PM · Bug Report, libksba
werner added a comment to T1771: Failing test t-oid on Solaris 10 Sparc.

That pretty much looks like you are using this new test program with an older
Libksba.

Nov 25 2014, 3:59 PM · Bug Report, libksba
dagobert added projects to T1771: Failing test t-oid on Solaris 10 Sparc: libksba, Bug Report.
Nov 25 2014, 2:10 PM · Bug Report, libksba
dagobert set Version to 1.3.2 on T1771: Failing test t-oid on Solaris 10 Sparc.
Nov 25 2014, 2:10 PM · Bug Report, libksba
werner removed a project from T1574: compilation error: AIX headers define TRUE and FALSE: Restricted Project.
Nov 25 2014, 12:27 PM · Bug Report, libksba
werner closed T1574: compilation error: AIX headers define TRUE and FALSE as Resolved.
Nov 25 2014, 12:27 PM · Bug Report, libksba
werner added a project to T1526: libksba gpg-error option incorrect: Duplicate.
Nov 25 2014, 12:27 PM · Duplicate, Bug Report, libksba
werner closed T1526: libksba gpg-error option incorrect as Resolved.
Nov 25 2014, 12:27 PM · Duplicate, Bug Report, libksba
werner added a comment to T1526: libksba gpg-error option incorrect.

Duplicate of T1467

Nov 25 2014, 12:27 PM · Duplicate, Bug Report, libksba
werner added a comment to T1526: libksba gpg-error option incorrect.

See the other bug. Will be fixed with the next release.

Nov 25 2014, 12:26 PM · Duplicate, Bug Report, libksba

Jan 31 2014

lmamane added a comment to T1467: libksba's configure script reports "--with-libgpg-error-prefix", expects "--with-gpg-error-prefix".

This happens because AM_PATH_GPG_ERROR uses AC_ARG_WITH
in a bad way. First it parses the official name, which
is --with-libgpg-error-prefix. But then it tries to implement
a fallback to the old undocumented option name
--with-gpg-error-prefix. Unfortunately, that fallback
unconditionally overwrites the result of the first
AC_ARG_WITH.

The enclosed patch fixes this issue.

This patch needs to be installed in both the libksba
and the gnupg repositories.

The same issue was however fixed in the libassuan repo
in 97ce28a430129ce997783c6196ccfe737f5b3007. Applying
that solution in the libksba and gnupg repos would work
just as fine as my patch (and reduce the proliferation
of differing versions).

I think T1526 is a duplicate of this bug.

I think T1561 is the same bug, but in the gnupg
repository.

Jan 31 2014, 11:18 PM · Bug Report, libksba
lmamane added a comment to T1467: libksba's configure script reports "--with-libgpg-error-prefix", expects "--with-gpg-error-prefix".

D166: 424_0001-configure-fix-with-libgpg-error-prefix.patch

Jan 31 2014, 11:18 PM · Bug Report, libksba

Dec 10 2013

werner added a comment to T1574: compilation error: AIX headers define TRUE and FALSE.

Fixed with commit ab3fe5d.

Dec 10 2013, 3:03 PM · Bug Report, libksba
werner removed a project from T1574: compilation error: AIX headers define TRUE and FALSE: In Progress.
Dec 10 2013, 3:03 PM · Bug Report, libksba
werner added a project to T1574: compilation error: AIX headers define TRUE and FALSE: Restricted Project.
Dec 10 2013, 3:03 PM · Bug Report, libksba
werner added a comment to T1574: compilation error: AIX headers define TRUE and FALSE.

The grammar is quite old and should anyway adjusted to modern standard. There
is a separately mainatained toke table which does not make much sense, given
that that it is possible to re-use the bison generated token table. I see what
I can do.

Dec 10 2013, 10:35 AM · Bug Report, libksba
werner added a project to T1574: compilation error: AIX headers define TRUE and FALSE: In Progress.
Dec 10 2013, 10:35 AM · Bug Report, libksba

Nov 29 2013

haubi set Version to 1.3.0 on T1574: compilation error: AIX headers define TRUE and FALSE.
Nov 29 2013, 3:07 PM · Bug Report, libksba
haubi added a comment to T1574: compilation error: AIX headers define TRUE and FALSE.

D184: 409_libksba-1.3.0-undef-true.patch

Nov 29 2013, 3:07 PM · Bug Report, libksba
haubi added projects to T1574: compilation error: AIX headers define TRUE and FALSE: libksba, Bug Report.
Nov 29 2013, 3:07 PM · Bug Report, libksba

Aug 14 2013

quanah added projects to T1526: libksba gpg-error option incorrect: libksba, Bug Report.
Aug 14 2013, 11:44 PM · Duplicate, Bug Report, libksba

Jan 23 2013

Score_Under added projects to T1467: libksba's configure script reports "--with-libgpg-error-prefix", expects "--with-gpg-error-prefix": libksba, Bug Report.
Jan 23 2013, 11:22 PM · Bug Report, libksba

Aug 19 2010

werner closed T1269: libksba: buffer overflow in append_ucs2_value() as Resolved.
Aug 19 2010, 2:14 PM · Bug Report, libksba