Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-118192

QNetworkAccessManager hang with low integrity level (low IL) sandboxing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.5.4, 6.6.1, 6.7.0 FF
    • 6.5.1, 6.6
    • Network: HTTP, Network: SSL
    • None
    • Windows 10 21H2. Visual Studio 2022.
    • Windows
    • 4d11ba66d (dev), a75ad8ddc (6.6), a439185ba (tqtc/lts-6.5)

      QNetworkAccessManager freezes when attempting to perform GET or POST operations from a process with low integrity level (low IL) sandboxing.

      Background: This bug is preventing my company from performing HTTP calls from Qt applications running on embedded medical devices.

      Steps to reproduce

      • Unzip attached reproducer
      • Build project on Windows.
      • From an administrator command prompt: Run icacls QtNetworkAuthSandboxing.exe /setintegritylevel Low to make the program run in low integrity level (low IL).
      • From a regular command prompt: Run QtNetworkAuthSandboxing.exe
      • Observe that the program freezes without any console output.

      Root cause

      The root cause appear to be the CertOpenSystemStore(0, L"ROOT") calls in qtls_schannel.cpp. These calls will fail when running under low IL due to lack of write access to the HKCU\SOFTWARE\Microsoft\SystemCertificates\ROOT registry key. This can be verified by monitoring registry access with Process Explorer.

      Proposed fix

      Replace the CertOpenSystemStore(0, L"ROOT") calls with CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, NULL, CERT_STORE_READONLY_FLAG | CERT_SYSTEM_STORE_CURRENT_USER, L"ROOT") so that the certificate store is opened in read-only mode.

        For Gerrit Dashboard: QTBUG-118192
        # Subject Branch Project Status CR V

            johanseg Jøger Hansegård
            forderud Fredrik Orderud
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes