Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent logging buggy without /etc/passwd #2147

Closed
azurit opened this issue Aug 14, 2019 · 3 comments
Closed

Concurrent logging buggy without /etc/passwd #2147

azurit opened this issue Aug 14, 2019 · 3 comments
Assignees
Labels
2.x Related to ModSecurity version 2.x

Comments

@azurit
Copy link

azurit commented Aug 14, 2019

Describe the bug

When running in environment without /etc/passwd (or without access to it), concurrent logging is very buggy as it cannot find user names, the uninitialized/empty memory data is used as names of files in /tmp and in SecAuditLogStorageDir. The problem is in file apache2/msc_logging.c, function construct_auditlog_filename, lines:

char *username;
...
apr_uid_name_get(&username, uid, mp);

The return value of function apr_uid_name_get should be checked and if getting user name failed, something other should be used (i suggest UID).

Server (please complete the following information):

  • ModSecurity version (and connector): 2.9.3
  • WebServer: apache 2.4.25 running in very strict environment done using apparmor
  • OS (and distro): Debian Stretch
@azurit
Copy link
Author

azurit commented Aug 14, 2019

Also file apache2/persist_dbm.c, functions collection_retrieve_ex, collection_store and collections_remove_stale.

@zimmerle zimmerle self-assigned this Sep 13, 2019
@zimmerle zimmerle added the 2.x Related to ModSecurity version 2.x label Sep 13, 2019
@zimmerle
Copy link
Contributor

Hi @azurit,

Thank you for the report, I am liking this issue to #2046 as it seems to be related.

@martinhsv
Copy link
Contributor

Closing per duplicate previously cited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to ModSecurity version 2.x
Projects
None yet
Development

No branches or pull requests

3 participants