Bug 51079

Summary: [PATCH] mod_fcgid spawned CGI Process cannot impersonate windows users in order to access resources/database located in a remote machine in same windows workgroup.
Product: Apache httpd-2 Reporter: Thangaraj AntonyCrouse <thangaraj>
Component: mod_fcgidAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED LATER    
Severity: enhancement Keywords: MassUpdate, PatchAvailable
Priority: P2    
Version: 2.2.17   
Target Milestone: ---   
Hardware: PC   
OS: Windows Server 2003   
Attachments: mod_fcgid spawned CGI Process cannot impersonate user in order to access resources/database located in a remote machine in same windows workgroup

Description Thangaraj AntonyCrouse 2011-04-18 20:39:01 UTC
Created attachment 26898 [details]
mod_fcgid spawned CGI Process cannot impersonate user in order to access resources/database located in a remote machine in same windows workgroup

Problem:
mod_fcgid spawned CGI Process cannot impersonate windows user in order to access resources(e.g. database) located in a remote machine in same windows workgroup.

Root Cause:
"APR 1.4.2" proc.c API does not implement Windows Impersonation by 
security delegation.
  
Solution (implemented in patch):
Enhanced APR 1.4.2 apr_procattr_user_set() functions to perform windows impersonation by Security delegation, added new APR API called apr_procattr_impersonation_level_set() that sets required windows impersonation level during apr_procattr_user_set() invocation.
And new Fcgid options are implemented to utilize APR enhancements that enable access to remote resources using windows impersonation by Security delegation in Windows server class OS is implemented.


Mod_cgid Configuration enhancement details:

Two new Fcgid options as mentioned below are created:
#
# CGI process impersonation specific configuration
#
#     FcgidImpersonation   <On|Off>
#                    
#            On  ->  Impersonation is set to On. 
#                    Requires FcgidImpersonationCredentialProvider.
#            Off ->  Impersonation is set to off. This is set by default. 
#
#
#
#     FcgidImpersonationCredentialProvider  <module path> <entry point>
#                       
#            <module path> -> DLL/SO path that provides Username and password 
#                             for impersonation. Can be absolute or relative 
#                             path.
#
#            <entry point> -> Function name that provides Username and password.
#
#            Function prototype:
#                  DWORD APIENTRY GetCredentials(
#                                          IN OUT BYTE* pUtf8UserNameBuffer, 
#                                          IN OUT DWORD* pdwUserNameBufferLen, 
#                                          IN OUT BYTE* pUtf8PasswordBuffer, 
#                                          IN OUT DWORD* pdwPasswordBufferLen);
#
#
#
# Sample:
#
# FcgidImpersonation On
# FcgidImpersonationCredentialProvider "../modules/CredProv.dll" GetCredentials
Comment 1 William A. Rowe Jr. 2012-01-19 17:32:29 UTC
The obvious hesitation is storing a password value in the configuration.

The reason this and the User directive have not been supported in httpd
is this fundamental weakness of the Windows security model, and that we
have not come up with any clever way to avoid it.
Comment 2 William A. Rowe Jr. 2018-11-07 21:08:02 UTC
Please help us to refine our list of open and current defects; this is a mass update of old and inactive Bugzilla reports which reflect user error, already resolved defects, and still-existing defects in httpd.

As repeatedly announced, the Apache HTTP Server Project has discontinued all development and patch review of the 2.2.x series of releases. The final release 2.2.34 was published in July 2017, and no further evaluation of bug reports or security risks will be considered or published for 2.2.x releases. All reports older than 2.4.x have been updated to status RESOLVED/LATER; no further action is expected unless the report still applies to a current version of httpd.

If your report represented a question or confusion about how to use an httpd feature, an unexpected server behavior, problems building or installing httpd, or working with an external component (a third party module, browser etc.) we ask you to start by bringing your question to the User Support and Discussion mailing list, see [https://httpd.apache.org/lists.html#http-users] for details. Include a link to this Bugzilla report for completeness with your question.

If your report was clearly a defect in httpd or a feature request, we ask that you retest using a modern httpd release (2.4.33 or later) released in the past year. If it can be reproduced, please reopen this bug and change the Version field above to the httpd version you have reconfirmed with.

Your help in identifying defects or enhancements still applicable to the current httpd server software release is greatly appreciated.