SQL Server 2022 CU27 - Msg 15247 State 112 accessing linked server configured as remote Distributor unless local login is sysadmin

Trenton Anderson 0 Reputation points
2026-12-01T17:44:26.0466667+00:00

We are investigating a reproducible linked-server authorization issue on SQL Server 2022 CU27 (16.0.4315.2).

The affected SQL Server has a remote Distributor configured. The corresponding linked server, Redacted01, is marked is_distributor = 1.

A non-sysadmin SQL login, Redacted, is unable to execute even a trivial OPENQUERY against this linked server and receives:

Msg 15247, Level 16, State 112
User does not have permission to perform this action.

If the same local login is temporarily added to the sysadmin fixed server role, the identical query succeeds.

When successful, we have confirmed that the existing linked-server mapping authenticates to the remote SQL Server successfully as the SQL login RedactedTest.

We have also added an explicit linked-server login mapping.

This does not change the behaviour. The non-sysadmin login continues to receive Msg 15247 State 112.

Granting VIEW SERVER STATE also does not resolve the issue.

The failure can be reproduced without accessing the application database or any application objects, using only a trivial remote identity query. This appears to rule out target database permissions and database user/login SID mappings.

Extended Events captures error_reported locally on the source SQL Server with:

error_number:                  15247 
state:                         112 
severity:                      16 
category:                      
SERVER database_name:                 master 
server_principal_name:         Redacted 
message:                       User does not have permission to perform this action. 

The server is running SQL Server 2022 CU27 build 16.0.4315.2.

CU27 includes fix 5723341, documented as:

"Strengthens security checks for linked server access in replication."

Given that the affected linked server is also the configured remote Distributor, we would like to confirm whether this behaviour is an intentional consequence of 5723341, whether an additional server permission is now required for non-sysadmin access, or whether ordinary distributed queries through a linked server marked as a Distributor are being unintentionally blocked.

SQL Server Database Engine

2 answers

Sort by: Most helpful
  1. Trenton Anderson 0 Reputation points
    2026-12-03T09:47:49.46+00:00

    Answer From Microsoft Support (will post a follow-up once confirmed):

    Thank you very much for your time, patience, and cooperation throughout this investigation.  In the meantime, I have had the opportunity to perform additional testing in my lab environment using SQL Server 2022 CU27 with security update KB5129300 installed: KB5129300 - Description of the security update for SQL Server 2022 CU27: November 10, 2026 - SQL Server | Microsoft Support I am pleased to share that I was able to successfully reproduce the same error you are experiencing in your environment.   Investigation Findings During my testing, I confirmed the following:

    • SQL Server 2022 CU27 without KB5129300: I was unable to reproduce the reported behavior, indicating that the security enhancement responsible for this restriction was not present in the CU27 build alone.
    • SQL Server 2022 CU27 with KB5129300: After installing the security update, I was able to reproduce the same error when executing queries against a linked server configured as a replication Distributor using a non-sysadmin account. 
    • Testing with sysadmin permissions: When I granted the sysadmin server role to the account executing the query, the query completed successfully, which is consistent with the behavior you previously reported.  Based on these findings, we can confirm that the behavior you are experiencing is associated with the security enhancements introduced for linked servers used in SQL Server replication.

    Although the security changes introduced through KB5129300 and CU28 are not necessarily identical in their internal implementation, both introduce security-related restrictions intended to strengthen access controls for linked servers configured as replication Distributors.         Therefore, the behavior observed in your environment is consistent with the expected security restrictions introduced by these updates.           Recommendations and Next Steps As previously discussed, the recommended approach depends on the intended purpose of the linked server.     Scenario 1: Linked Server Used Exclusively for Application Queries (our situation) If a linked server is used exclusively for application queries and is not involved in SQL Server replication, having its dist property configured as true unnecessarily identifies it as a replication Distributor. In this scenario, after confirming that the linked server is not required for replication, the recommended approach would be to correct its configuration by setting the dist property to false. This would avoid unnecessarily applying the security restrictions associated with replication Distributor linked servers, without requiring elevated permissions. Scenario 2: Linked Server Configured as an Actual Replication Distributor If the linked server is genuinely used as a replication Distributor, the dist property should not be disabled simply to bypass the security restrictions. For replication-related operations, the recommended approach is to use the supported SQL Server replication system stored procedures and their corresponding administrative security contexts.

    Was this answer helpful?

    0 comments No comments

  2. Erland Sommarskog 138K Reputation points MVP Volunteer Moderator
    2026-12-01T19:32:31.58+00:00

    I was able to reproduce the behaviour. I did

    EXEC sp_addlinkedserver 'CONTAG1\REPLTEST'
    EXEC sp_serveroption 'CONTAG1\REPLTEST', 'dist', 'true'
    

    And I also set up login-mapping to make it easier to test with a non-admin user.

    I also tried this on SQL 2019 and got the same error. When I tried it on SQL 2016, I did not get that error. My conclusion from this is that this is not a change that came in CU27 per se, but in one of the recent GDRs. (Which all I have included a long list of security fixes.)

    I can't speak for Microsoft, but this very much looks like as "by design". The linked server is intended to be used for the distribution of replication. If you have used it for more than that, you might have been in the land of unsupported all the time.

    I have an instance where I have replication set up (with a local distributor). When I try to use the linked server repl_distributor for OPENQUERY, I am told that it is not enabled for DATA ACCESS. But maybe someone at your site did that at one point, thinking they were smart. (When they should have set up a second linked server for application use.)

    Good call on opening a case with Microsoft. That's the only way to get absolute clarity. And maybe they have a trace flag to override the behaviour.

    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.