Supported Windows IPC boundary for mutual application authentication under handle delegation

Tammy Kelly 0 Reputation points
2026-11-10T19:06:52.4766667+00:00

We are designing a secure, local, read-only connection between two native Windows applications. Each operation requires native user approval. No protected-data transport is currently enabled.

We need both applications to verify the other's approved application and signing identity, restrict communication to the current user and logon session, and prevent unrelated applications running as the same user from exercising communication authority.

A native diagnostic on Windows 10.0.26300.0 demonstrated that:

  • Process A opened a named pipe using a non-inheritable handle.
  • A deliberately duplicated the handle and passed it to a different executable, B.
  • B successfully wrote a non-sensitive test marker.
  • GetNamedPipeClientProcessId continued to report A.
  • Logon-SID restrictions, a same-session check, and remote-client rejection did not prevent the delegated write.

This was a cooperating-fixture experiment, not a demonstrated security vulnerability or bypass of AppContainer or App Services.

We have considered signed MSIX packaging, AppContainer isolation, package-SID access controls, Windows App Services, and local RPC.

Questions for Microsoft:

  1. Is there a supported Windows IPC mechanism that authenticates both approved application identities, rather than only the user or original connection creator?
  2. Can App Services connection authority be duplicated, marshaled, inherited, or transferred to another process? Is caller identity established at activation, connection creation, or per request?
  3. What documented controls protect against hostile same-user desktop processes stealing handles, injecting code, or substituting executable dependencies?
  4. How should applications bind package identity to approved signing identity and enforce current-user and logon-session isolation?
  5. What protections exist against authorized endpoints relaying requests from unauthorized applications? If deliberate delegation is outside the guarantee, what trust assumptions are required?
  6. Which Microsoft documentation and verification tests establish these boundaries, including impersonation, process restart, package updates, and concurrent logon sessions?

Our primary threat model is an unrelated, non-administrative process running as the same user. We are seeking supported architecture guidance before implementing protected communication.

Windows development | Windows API - Win32
0 comments No comments

2 answers

Sort by: Oldest
  1. AI answer

    2026-11-10T19:09:06.18+00:00

    A named-pipe handle or connection PID must not be treated as continuing application authentication; use AppContainer/package identity to restrict initial access, then require fresh operation-bound authorization from a component the authorized endpoint cannot delegate or misuse.

    Documented boundary of the pipe experiment

    The observed result is consistent with documented handle semantics:

    • Pipe handles can be duplicated into another, unrelated process and used there. Non-inheritability prevents inheritance during process creation; it does not prevent deliberate DuplicateHandle use.^1^
    • DuplicateHandle produces a handle valid in the target process, provided the required PROCESS_DUP_HANDLE rights are available.^2^
    • GetNamedPipeClientProcessId reports the client process identifier associated with the pipe instance; its contract does not say that it identifies the process performing every subsequent I/O operation.^3^
    • A pipe DACL is checked when a client opens the pipe. A logon-SID ACE can exclude other logon sessions, but it does not cause a new access check on every write through an already granted or duplicated handle.^4^

    Named-pipe impersonation similarly exposes the security context associated with the last message read; it authenticates a user/token context, not the executable currently holding a delegated handle. Failure must be checked before processing the request.^5^

    Supported architecture for this threat model

    Use two distinct controls rather than expecting one IPC primitive to supply both.

    1. Package and isolate both endpoints. Run each endpoint in AppContainer or Win32 app isolation. An AppContainer token contains a package SID plus capability SIDs; access is the intersection of user/group and AppContainer grants.^6^
    2. Restrict initial IPC acquisition. Put the current logon SID and the intended package/capability SID on the IPC object's DACL, grant only the required direction-specific rights, and reject remote connections. This excludes other users, sessions, and packages from opening the endpoint, but does not revoke authority after an authorized endpoint delegates it.
    3. Authorize each operation. Bind approval to:
      • exact operation and parameters;
      • both expected package identities;
      • user/logon context;
      • server-generated nonce;
      • short expiry;
      • one-time consumption.
    4. Keep approval authority outside the requesting endpoint. The signature or MAC must be issued by an isolated broker, trusted UI, service, or protected key holder that independently displays and approves the exact operation. If the authorized endpoint itself controls the credential, it can authenticate relayed requests; deliberate relay is then outside the guarantee.

    A minimal request envelope is:

    struct AuthorizedRequest {
        GUID operationId;
        std::vector<std::byte> canonicalParameters;
        std::array<std::byte, 32> serverNonce;
        uint64_t expiresAt;
        std::wstring callerPackageFamily;
        std::wstring calleePackageFamily;
        std::vector<std::byte> approvalSignature;
    };
    // Server verifies identities, nonce, expiry, signature, and one-time use
    // immediately before executing the read-only operation.
    

    AppContainer is a recognized isolation boundary and prevents lower-integrity container processes from injecting into higher-integrity processes; capabilities and DACLs provide least-privilege resource access.^7^ This is the primary same-user isolation control. Process mitigations are defense in depth, not caller authentication.

    App Services: what is documented and unresolved

    An App Service provider receives an AppServiceConnection, and activation details expose CallerPackageFamilyName; the provider can also test whether the caller has a declared capability.^8^^9^

    The public contracts supplied here do not establish:

    • whether connection authority can be marshaled into another process;
    • whether caller package identity is revalidated per message;
    • whether identity is fixed at activation or connection creation;
    • whether an authorized caller may relay arbitrary requests;
    • whether App Services support the exact cross-package desktop/AppContainer topology required here.

    The Agile marshaling attribute on AppServiceConnection should not be interpreted as a cross-process security or non-transferability guarantee.^10^

    Open a Microsoft developer support case before selecting App Services as the security boundary. Request written confirmation for those five points, including the targeted Windows build, packaging model, and whether identity/capability checks occur per request.

    Package and signing identity

    A package identity includes its name and certificate-derived Publisher; the Package Family Name derives from name and publisher and is version-independent.^11^ The manifest Publisher must match the signing certificate subject.^12^

    Maintain an allowlist containing the expected PFN and publisher policy. Define update behavior explicitly: accepting the same PFN normally spans package versions, while publisher changes require a planned identity transition—not an implicit trust decision.

    Verification matrix

    Require these pass/fail results before deployment:

    Test Required result
    Unapproved package opens endpoint Access denied before a connection is established
    Same user, different logon session Access denied by logon-SID/session policy
    Remote client Rejected
    Authorized handle deliberately duplicated Transport may remain usable; request fails without fresh operation authorization
    Captured request replayed Rejected due to consumed nonce or expiry
    Authorized endpoint proxies a request Rejected only if approval comes from an independent trusted component; otherwise documented as allowed
    Client/server restarts Old nonces and authorization state rejected by design; transport-specific stale-handle behavior tested, not assumed
    Package update with approved publisher/PFN Accepted according to the explicit version policy
    Publisher/PFN changed Rejected unless an approved migration policy applies
    Concurrent sessions Only the approving logon session succeeds
    Injection/dependency substitution attempt Blocked by isolation/mitigations or detected; never accepted as proof of IPC identity

    References

    1. Anonymous Pipe Operations
    2. DuplicateHandle function (handleapi.h)
    3. GetNamedPipeClientProcessId function (winbase.h)
    4. Named Pipe Security and Access Rights
    5. ImpersonateNamedPipeClient function (namedpipeapi.h)
    6. Launch an AppContainer
    7. Application isolation
    8. AppServiceTriggerDetails Class-Definition
    9. AppServiceTriggerDetails.CheckCallerForCapabilityAsync(String) Method-Definition
    10. AppServiceConnection Class-Definition
    11. An overview of Package Identity in Windows apps
    12. Create a certificate for package signing
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. Harry Nguyen (WICLOUD CORPORATION) 690 Reputation points Microsoft External Staff Moderator
    2026-11-11T03:36:29.0133333+00:00

    Hi @Tammy Kelly , 

    Thank you for sharing your detailed threat model and test results. 

    Based on the publicly available Microsoft documentation, I would like to clarify the following points. 

    Firstly, regarding named pipes and handle delegation, the DuplicateHandle documentation confirms that handles can be duplicated between processes. GetNamedPipeClientProcessId identifies the pipe client but does not document per-request process authentication. Similarly, Named Pipe Security and ImpersonateNamedPipeClient provide access control and impersonation mechanisms, not a documented guarantee against deliberate handle delegation. 

    In addition, regarding AppContainer and application identity, AppContainer isolation provides application isolation using package SIDs, capabilities, and access controls. Package Identity and Package Signing describe package and publisher identity. However, these mechanisms do not establish per-request executable authentication or protection against authorized request relay. 

    Furthermore, regarding App Services, AppServiceTriggerDetails exposes caller package identity and capability checks. However, the public documentation does not explicitly establish whether connection authority can be transferred, when caller identity is validated, or whether deliberate request relay is prevented. 

    Finally, regarding security guarantees and verification, the referenced documentation does not establish a complete end-to-end guarantee covering same-user process interference, handle delegation, request relay, process restarts, package updates, and concurrent logon sessions. 

    Given these documentation boundaries, we can confirm the individual API behaviors described above, but cannot validate the complete security architecture against your threat model. 

    As this is a community forum, my guidance is limited to public Microsoft documentation and verifiable test results. Since your remaining questions require deeper validation of Windows security guarantees, I recommend opening a support ticket through Microsoft Support for further assistance from the appropriate technical team. 

    I hope this helps. If you found my response helpful or informative, you can follow this guidance so others with a similar question can find it more easily. 

    Thank you. 

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.