NetBSD Problem Report #44745

From www@NetBSD.org  Sat Mar 19 18:29:26 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id C867F63B9D5
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 19 Mar 2011 18:29:26 +0000 (UTC)
Message-Id: <20110319182925.82BD463B8A9@www.NetBSD.org>
Date: Sat, 19 Mar 2011 18:29:25 +0000 (UTC)
From: msporleder@gmail.com
Reply-To: msporleder@gmail.com
To: gnats-bugs@NetBSD.org
Subject: security/ap-modsecurity2 upgrade
X-Send-Pr-Version: www-1.0

>Number:         44745
>Category:       pkg
>Synopsis:       security/ap-modsecurity2 upgrade
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dholland
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 19 18:30:00 +0000 2011
>Closed-Date:    Sat Mar 19 22:27:42 +0000 2011
>Last-Modified:  Sun Mar 20 01:00:04 +0000 2011
>Originator:     matthew sporleder
>Release:        5.0.2
>Organization:
mspo.com
>Environment:
amd64
>Description:
ap-modsecurity2 seems to have some issues.  I have removed patch-aa, added some dependencies, upgraded the pkg, and defined a license.


29 Nov 2010 - 2.5.13
--------------------

 * Cleaned up some mlogc code and debugging output.

 * Remove the ability to use a relative path to a piped audit logger
   (i.e. mlogc) as Apache does not support it in their piped loggers
   and it was breaking Windows and probably other platforms that
   use spaces in filesystem paths.  Discovered by Tom Donovan.

 * Fix memory leak freeing regex.  Discovered by Tom Donovan.

 * Fix some portability issues on Windows.

 * Fixed Geo lookup concurrent connections bug

 * Fixed Skip/SkipAfter chain bug

 * Added new setvar Lua API to be used into Lua scripts

 * Added PCRE messages indicates each rule that exceed match limits

 * Added new Base64 transformation function called base64DecodeEx, which
   can decode base64 data skipping special characters.

 * Add SecReadStateLimit to limit the number of concurrent threads in BUSY connections per ip address

 * Fixed redirect action was not expanding macros in chained rules



04 Feb 2010 - 2.5.12
--------------------

 * Fixed SecUploadFileMode to set the correct mode.

 * Fixed nolog,auditlog/noauditlog/nolog controls for disruptive actions.

 * Added additional file info definitions introduced in APR 0.9.5 so that
   build will work with older APRs (IBM HTTP Server v6).

 * Added SecUploadFileLimit to limit the number of uploaded file parts that
   will be processed in a multipart POST.  The default is 100.

 * Fixed path normalization to better handle backreferences that extend
   above root directories.  Reported by Sogeti/ESEC R&D.

 * Trim whitespace around phrases used with @pmFromFile and allow
   for both LF and CRLF terminated lines.

 * Allow for more robust parsing for multipart header folding.  Reported
   by Sogeti/ESEC R&D.

 * Fixed failure to match internally set TX variables with regex
   (TX:/.../) syntax.

 * Fixed failure to log full internal TX variable names and populate
   MATCHED_VAR* vars.

 * Enabled PCRE "studying" by default.  This is now a configure-time option.

 * Added PCRE match limits (SecPcreMatchLimit/SecPcreMatchLimitRecursion) to
   aide in REDoS type attacks.  A rule that goes over the limits will set
   TX:MSC_PCRE_LIMITS_EXCEEDED.  It is intended that the next major release
   of ModSecurity (2.6.x) will move these flags to a dedicated collection.

 * Reduced default PCRE match limits reducing impact of REDoS on poorly
   written regex rules.  Reported by Sogeti/ESEC R&D.

 * Fixed memory leak in v1 cookie parser.  Reported by Sogeti/ESEC R&D.

 * Now support macro expansion in numeric operators (@eq, @ge, @lt, etc.)

 * Update copyright to 2010.

 * Reserved 700,000-799,999 IDs for Ivan Ristic.

 * Fixed SecAction not working when CONNECT request method is used
   (MODSEC-110). [Ivan Ristic]

 * Do not escape quotes in macro resolution and only escape NUL in setenv
   values.


04 Nov 2009 - 2.5.11
--------------------

 * Added a new multipart flag, MULTIPART_INVALID_QUOTING, which will be
   set true if any invalid quoting is found during multipart parsing.

 * Fixed parsing quoted strings in multipart Content-Disposition headers.
   Discovered by Stefan Esser.

 * Cleanup persistence database locking code.

 * Added warning during configure if libcurl is found linked against
   gnutls for SSL.  The openssl lib is recommended as gnutls has
   proven to cause issues with mutexes and may crash.

 * Cleanup some mlogc (over)logging.

 * Do not log output filter errors in the error log.

 * Moved output filter to run before other stock filters (mod_deflate,
   mod_cache, mod_expires, mod_filter) to avoid analyzing modified data
   in the response.  Patch originally submitted by Ivan Ristic.



18 Sep 2009 - 2.5.10
--------------------

 * Cleanup mlogc so that it builds on Windows.

 * Added more detailed messages to replace "Unknown error" in filters.

 * Added SecAuditLogDirMode and SecAuditLogFileMode to allow fine tuning
   auditlog permissions (especially with mpm-itk).

 * Cleanup SecUploadFileMode implementation.

 * Cleanup build scripts.

 * Fixed crash on configuration if SecMarker is used before any rules.

 * Fixed SecRuleUpdateActionById so that it will work on chain starters.

 * Cleanup build system for mlogc.

 * Allow mlogc to periodically flush memory pools.

 * Using nolog,auditlog will now log the "Message:" line to the auditlog, but
   nothing to the error log.  Prior versions dropped the "Message:" line from
   both logs.  To do this now, just use "nolog" or "nolog,noauditlog".

 * Forced mlogc to use SSLv3 to avoid some potential auto negotiation
   issues with some libcurl versions.

 * Fixed mlogc issue seen on big endian machines where content type
   could be listed as zero.

 * Removed extra newline from audit log message line when logging XML errors.
   This was causing problems parsing audit logs.

 * Fixed @pm/@pmFromFile case insensitivity.


 * Truncate long parameters in log message for "Match of ... against ...
   required" messages.

 * Correctly resolve chained rule actions in logs.

 * Cleanup some code for portability.

 * AIX does not support hidden visibility with xlc compiler.

 * Allow specifying EXTRA_CFLAGS during configure to override gcc specific
   values for non-gcc compilers.

 * Populate GEO:COUNTRY_NAME and GEO:COUNTRY_CONTINENT as documented.

 * Handle a newer geo database more gracefully, avoiding a potential crash for
   new countries that ModSecurity is not yet aware.

 * Allow checking &GEO "@eq 0" for a failed @geoLookup.

 * Fixed mlogc global mutex locking issue and added more debugging output.

 * Cleaned up build dependencies and configure options.

>How-To-Repeat:

>Fix:
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/security/ap-modsecurity2/Makefile,v
retrieving revision 1.15
diff -r1.15 Makefile
3c3
< DISTNAME=     modsecurity-apache_2.5.9
---
> DISTNAME=     modsecurity-apache_2.5.13
6a7
> LICENSE=      gnu-gpl-v2
25a27,29
> CONFIGURE_ARGS+=        --with-lua=${PREFIX}
> CONFIGURE_ARGS+=        --with-apr=${PREFIX}
> CONFIGURE_ARGS+=        --with-apu=${PREFIX}
48a53,55
> .include "../../lang/lua/buildlink3.mk"
> .include "../../devel/apr/buildlink3.mk"
> .include "../../devel/apr-util/buildlink3.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/security/ap-modsecurity2/distinfo,v
retrieving revision 1.6
diff -r1.6 distinfo
3,6c3,5
< SHA1 (modsecurity-apache_2.5.9.tar.gz) = 875919332a918956371fe8e2f7e46d88081857cf
< RMD160 (modsecurity-apache_2.5.9.tar.gz) = adab10e5eab50f0d114e3ccb47c343e744119c8f
< Size (modsecurity-apache_2.5.9.tar.gz) = 1252295 bytes
< SHA1 (patch-aa) = 19642ee3f22bd502208ee868cf24fb050bd2c56d
---
> SHA1 (modsecurity-apache_2.5.13.tar.gz) = dff3dc2b360aeb4a4feebc94ff3d507a4dfad0cf
> RMD160 (modsecurity-apache_2.5.13.tar.gz) = 2e7be42d5a755acc888ef28cf44598cc2540a207
> Size (modsecurity-apache_2.5.13.tar.gz) = 1421293 bytes

Remove patch-aa..
cvs diff: Diffing patches
cvs diff: cannot find patches/patch-aa

>Release-Note:

>Audit-Trail:
From: matthew sporleder <msporleder@gmail.com>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org
Subject: Re: pkg/44745: security/ap-modsecurity2 upgrade
Date: Sat, 19 Mar 2011 15:40:11 -0400

 --- Makefile    31 Aug 2009 07:19:44 -0000      1.15
 +++ Makefile    19 Mar 2011 19:35:19 -0000
 @@ -1,9 +1,10 @@
  # $NetBSD: Makefile,v 1.15 2009/08/31 07:19:44 seb Exp $

 -DISTNAME=      modsecurity-apache_2.5.9
 +DISTNAME=      modsecurity-apache_2.5.13
  PKGNAME=       ${APACHE_PKG_PREFIX}-${DISTNAME:S/apache_//}
  CATEGORIES=    www security
  MASTER_SITES=  http://www.modsecurity.org/download/
 +LICENSE=       gnu-gpl-v2

  MAINTAINER=    pkgsrc-users@NetBSD.org
  HOMEPAGE=      http://www.modsecurity.org/
 @@ -20,9 +21,12 @@
  USE_LIBTOOL=           yes
  WRKSRC=                        ${WRKDIR}/${DISTNAME}/apache2

 -CONFIGURE_ARGS+=       --with-apxs=${PREFIX}/sbin/apxs
 -CONFIGURE_ARGS+=       --with-pcre=${PREFIX}
 -CONFIGURE_ARGS+=        --with-libxml=${PREFIX}
 +CONFIGURE_ARGS+=       --with-apxs=${APXS}
 +CONFIGURE_ARGS+=       --with-pcre=${BUILDLINK_PREFIX.pcre}
 +CONFIGURE_ARGS+=        --with-libxml=${BUILDLINK_PREFIX.libxml2}
 +CONFIGURE_ARGS+=        --with-lua=${BUILDLINK_PREFIX.lua}
 +CONFIGURE_ARGS+=        --with-apr=${BUILDLINK_PREFIX.apr}
 +CONFIGURE_ARGS+=        --with-apu=${BUILDLINK_PREFIX.apr-util}

  SUBST_CLASSES+=                config
  SUBST_STAGE.config=    post-patch
 @@ -46,4 +50,6 @@

  .include "../../textproc/libxml2/buildlink3.mk"
  .include "../../devel/pcre/buildlink3.mk"
 +.include "../../lang/lua/buildlink3.mk"
 +.include "../../mk/apache.mk"
  .include "../../mk/bsd.pkg.mk"

Responsible-Changed-From-To: pkg-manager->dholland
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sat, 19 Mar 2011 21:09:11 +0000
Responsible-Changed-Why:
take
(thought this was going to be fast, it wasn't)


State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 19 Mar 2011 22:27:42 +0000
State-Changed-Why:
Committed (with some extra hacking), thanks.
No idea where the commit message went, maybe it got lost when homeworld
crashed.


From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44745 CVS commit: pkgsrc/security/ap-modsecurity2
Date: Sat, 19 Mar 2011 21:18:06 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Sat Mar 19 21:18:06 UTC 2011

 Modified Files:
 	pkgsrc/security/ap-modsecurity2: Makefile distinfo
 	pkgsrc/security/ap-modsecurity2/patches: patch-aa

 Log Message:
 Update ap-modsecurity2 to 2.5.13, partly from Matthew Sporleder in
 PR 44745, rest by me.

 pkgsrc changes:
    - fix up deps
    - fix Apache module handling
    - DESTDIR support

 XXX: The DESTDIR support has to bypass apxs because as far as I can tell
 XXX: apxs -i doesn't know how to handle DESTDIRs. Various Apache modules
 XXX: do this in various different ways. Someone(TM) should teach apxs -i
 XXX: about DESTDIRs and fix up all the abuse. The infrastructure for
 XXX: Apache modules could use some rototilling as well.

 29 Nov 2010 - 2.5.13
 --------------------

  * Cleaned up some mlogc code and debugging output.

  * Remove the ability to use a relative path to a piped audit logger
    (i.e. mlogc) as Apache does not support it in their piped loggers
    and it was breaking Windows and probably other platforms that
    use spaces in filesystem paths.  Discovered by Tom Donovan.

  * Fix memory leak freeing regex.  Discovered by Tom Donovan.

  * Fix some portability issues on Windows.

  * Fixed Geo lookup concurrent connections bug

  * Fixed Skip/SkipAfter chain bug

  * Added new setvar Lua API to be used into Lua scripts

  * Added PCRE messages indicates each rule that exceed match limits

  * Added new Base64 transformation function called base64DecodeEx, which
    can decode base64 data skipping special characters.

  * Add SecReadStateLimit to limit the number of concurrent threads in BUSY connections per ip address

  * Fixed redirect action was not expanding macros in chained rules

 04 Feb 2010 - 2.5.12
 --------------------

  * Fixed SecUploadFileMode to set the correct mode.

  * Fixed nolog,auditlog/noauditlog/nolog controls for disruptive actions.

  * Added additional file info definitions introduced in APR 0.9.5 so that
    build will work with older APRs (IBM HTTP Server v6).

  * Added SecUploadFileLimit to limit the number of uploaded file parts that
    will be processed in a multipart POST.  The default is 100.

  * Fixed path normalization to better handle backreferences that extend
    above root directories.  Reported by Sogeti/ESEC R&D.

  * Trim whitespace around phrases used with @pmFromFile and allow
    for both LF and CRLF terminated lines.

  * Allow for more robust parsing for multipart header folding.  Reported
    by Sogeti/ESEC R&D.

  * Fixed failure to match internally set TX variables with regex
    (TX:/.../) syntax.

  * Fixed failure to log full internal TX variable names and populate
    MATCHED_VAR* vars.

  * Enabled PCRE "studying" by default.  This is now a configure-time option.

  * Added PCRE match limits (SecPcreMatchLimit/SecPcreMatchLimitRecursion) to
    aide in REDoS type attacks.  A rule that goes over the limits will set
    TX:MSC_PCRE_LIMITS_EXCEEDED.  It is intended that the next major release
    of ModSecurity (2.6.x) will move these flags to a dedicated collection.

  * Reduced default PCRE match limits reducing impact of REDoS on poorly
    written regex rules.  Reported by Sogeti/ESEC R&D.

  * Fixed memory leak in v1 cookie parser.  Reported by Sogeti/ESEC R&D.

  * Now support macro expansion in numeric operators (@eq, @ge, @lt, etc.)

  * Update copyright to 2010.

  * Reserved 700,000-799,999 IDs for Ivan Ristic.

  * Fixed SecAction not working when CONNECT request method is used
    (MODSEC-110). [Ivan Ristic]

  * Do not escape quotes in macro resolution and only escape NUL in setenv
    values.

 04 Nov 2009 - 2.5.11
 --------------------

  * Added a new multipart flag, MULTIPART_INVALID_QUOTING, which will be
    set true if any invalid quoting is found during multipart parsing.

  * Fixed parsing quoted strings in multipart Content-Disposition headers.
    Discovered by Stefan Esser.

  * Cleanup persistence database locking code.

  * Added warning during configure if libcurl is found linked against
    gnutls for SSL.  The openssl lib is recommended as gnutls has
    proven to cause issues with mutexes and may crash.

  * Cleanup some mlogc (over)logging.

  * Do not log output filter errors in the error log.

  * Moved output filter to run before other stock filters (mod_deflate,
    mod_cache, mod_expires, mod_filter) to avoid analyzing modified data
    in the response.  Patch originally submitted by Ivan Ristic.

 18 Sep 2009 - 2.5.10
 --------------------

  * Cleanup mlogc so that it builds on Windows.

  * Added more detailed messages to replace "Unknown error" in filters.

  * Added SecAuditLogDirMode and SecAuditLogFileMode to allow fine tuning
    auditlog permissions (especially with mpm-itk).

  * Cleanup SecUploadFileMode implementation.

  * Cleanup build scripts.

  * Fixed crash on configuration if SecMarker is used before any rules.

  * Fixed SecRuleUpdateActionById so that it will work on chain starters.

  * Cleanup build system for mlogc.

  * Allow mlogc to periodically flush memory pools.

  * Using nolog,auditlog will now log the "Message:" line to the auditlog, but
    nothing to the error log.  Prior versions dropped the "Message:" line from
    both logs.  To do this now, just use "nolog" or "nolog,noauditlog".

  * Forced mlogc to use SSLv3 to avoid some potential auto negotiation
    issues with some libcurl versions.

  * Fixed mlogc issue seen on big endian machines where content type
    could be listed as zero.

  * Removed extra newline from audit log message line when logging XML errors.
    This was causing problems parsing audit logs.

  * Fixed @pm/@pmFromFile case insensitivity.

  * Truncate long parameters in log message for "Match of ... against ...
    required" messages.

  * Correctly resolve chained rule actions in logs.

  * Cleanup some code for portability.

  * AIX does not support hidden visibility with xlc compiler.

  * Allow specifying EXTRA_CFLAGS during configure to override gcc specific
    values for non-gcc compilers.

  * Populate GEO:COUNTRY_NAME and GEO:COUNTRY_CONTINENT as documented.

  * Handle a newer geo database more gracefully, avoiding a potential crash for
    new countries that ModSecurity is not yet aware.

  * Allow checking &GEO "@eq 0" for a failed @geoLookup.

  * Fixed mlogc global mutex locking issue and added more debugging output.

  * Cleaned up build dependencies and configure options.


 To generate a diff of this commit:
 cvs rdiff -u -r1.16 -r1.17 pkgsrc/security/ap-modsecurity2/Makefile
 cvs rdiff -u -r1.6 -r1.7 pkgsrc/security/ap-modsecurity2/distinfo
 cvs rdiff -u -r1.6 -r1.7 pkgsrc/security/ap-modsecurity2/patches/patch-aa

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.