Skip to content

ProcessContainer: PSEC creation returns 0x80070005 after successful probe/dry-run (SDK 1.0.1) #1648

Open

Description

@Max19970

Relevant area(s)

Windows

Brief description of your issue

On 2026-10-28 a Node-marker attempt using SDK 1.0.1 and its raw wire contract (version:"1.0.0") reached PSEC creation and failed before workload output. Containment was processcontainer, fallback.allowDaclMutation:false; the attempt performed no elevation, ACL/LABEL writes or host preparation. The failure-time caller integrity was not measured. The pinned SDK native CLI was used; --probe selected tier:"base-container" with needsDaclAugmentation:false, and --dry-run validated the request. The real run then failed:

failed to create the process security environment: CreateProcessSecurityEnvironment failed (HRESULT = 0x80070005)

This is an unexpected PSEC startup failure, not a claim of a confirmed SDK defect. allowDaclMutation:false is a fixed safety condition, not an asserted cause, and the probe reported that no DACL augmentation was required. This is integration-captured, not yet a standalone minimal reproducer; full fixture roots are redacted and the SDK-generated native payload was not recorded.

Main question: what supported non-mutating way identifies the access check that failed here? Secondary: do the docs name prerequisites for processcontainer PSEC with allowDaclMutation:false? Related but distinct: #1631 (documentation, session-0 batch-logon 0x80070002, OS 26200.9711), #1451 (launch-prerequisite docs), and #1576 (denied path under a missing parent, 0x80070003 — our denied file's parent exists). No shared root cause is asserted.

Steps to reproduce

Environment at failure: Windows x64, osRelease 10.0.26100, revision unknown; SDK 1.0.1 (npm, no commit); Node v24.22.1; raw wire 1.0.0; typedSdkUsed:false. A later read-only snapshot showed 26100.9711; that is not the failure-time revision.

  1. Create a fixture under an existing private temp root: two writable directories, one read-only directory, and one denied file outside the grants whose parent directory exists; plus writable and ungranted sibling files and read-only native-runtime and diagnostics roots. All paths pre-exist.
  2. Build the raw config with containment:"processcontainer", fallback.allowDaclMutation:false, the fixture grants, and read-only runtime/diagnostics roots. The report retains selected config fields and a rendered dry-run command, not the full raw policy JSON.
  3. Run --probe (exit 0) and --dry-run (exit 0, "validation passed"). A rendered CLI command was captured with full roots redacted; the SDK-generated native payload was not recorded.
  4. Launch the Node-marker workload via wxc-exec.exe --config: exit 4294967295, 71 ms, stdout 0 B, marker records 0, and the error below.

Expected behavior

Native PSEC creation succeeds with no DACL or LABEL changes, or MXC rejects before creation with an actionable preflight error that names the failing check and its contract. A fallback to a DACL-mutating or unconfined mode is not acceptable.

Actual behavior

Relevant excerpt from 274 B of stderr (the remainder is a backend_error JSON object repeating the same message):

failed to create the process security environment: CreateProcessSecurityEnvironment failed (HRESULT = 0x80070005)

Exit 4294967295, no signal, no timeout, no workload output or marker observed. Not recorded at failure: Win32 GetLastError, processmodel.dll version, caller token/privileges/environment, or OS revision. No dumps or traces are attached; this is not a security report or BSOD.

Activity

  1. added
    Needs-Triage
    Issue-Bug
    OS-Windows
    on Nov 3, 2026
  2. added
    Backend-ProcessContainer
    and removed
    Needs-Triage
    on Nov 5, 2026
  3. Max19970 commented on Nov 6, 2026

    @Max19970
    Author

    Follow-up with a strict separation between our archived failure and independently reported direct-PSEC controls. No new PSEC execution, elevation, ACL/LABEL change, or fallback was performed for this follow-up.

    Our failure-time evidence (2026-10-28)

    Field What was actually recorded
    OS release 10.0.26100, x64
    OS UBR Not captured at failure time
    processmodel.dll version Not captured at failure time
    QueryProcessSecurityEnvironmentSupport HRESULT / raw flags Not captured. The SDK probe reported base-container, API present, and needsDaclAugmentation:false; these are not raw QuerySupport flags.
    Caller integrity / token elevation / job membership Not captured. The launcher recorded that it performed no elevation; that does not establish the caller token's elevation or integrity.
    Create boundary CreateProcessSecurityEnvironment returned 0x80070005; workload stdout and marker records were both zero.
    Request path SDK 1.0.1, raw wire 1.0.0, explicit processcontainer, fallback.allowDaclMutation:false.

    A later read-only OS snapshot (2026-11-03) records 26100.9711. Current read-only DLL metadata records 10.0.26100.9711, with a file last-write timestamp of 2026-10-14. Neither retrospectively measures the October 28 caller or failure-time UBR/DLL version. We do not substitute a later Medium-caller observation for the original failure token.

    The documented ProcessContainer floor for 24H2 is 26100.9278, below the later snapshot. Being above the documented floor does not identify the failing access check or exclude a build-specific OS defect.

    Independent direct-Create controls

    openai/codex#53650, direct-PSEC report documents a different host: Windows 26300.9711, System32 processmodel.dll 10.0.26100.9711. Its raw QuerySupport returned S_OK / 0xF. Direct Create returned 0x80070005 both under the execution job and from an ordinary PowerShell with IsProcessInJob=false, TokenElevated=0, TokenElevationType=Limited, TokenIsAppContainer=0; no child was created. The follow-up reports the same result for populated as well as minimal policies.

    Thus job membership and elevation are not necessary for that independently observed symptom. These are not measurements from our host, and a matching HRESULT does not prove a shared underlying access check. #1485 separately reports working MXC 0.8 workloads on 26200.9457; it is not our direct-Create control. We have no available second 25H2/26H2 machine and have not run another experiment.

    Standalone source

    The accompanying minimal one-directory source is not compiled or run; it is supplied for review, not as a claimed new reproduction. It performs no child/payload launch and has no SDK, harness, ACL mutation or fallback.

    This is the complete 40-line C++ source (Windows SDK / MSVC). Its embedded FlatBuffer is CPSE 1.0, file identifier PSEC, exactly one RW root C:\PsecRepro; capabilities, RO/deny vectors, network policy and 1.1-only fields are omitted. The folder must already exist. Omitted network policy is not presented as enforced deny. The public schema defines this layout; Create and Close are the documented API boundary. This intentionally minimal policy is not claimed to be the original unrecorded SDK-native payload.

    // NOT RUN. Self-contained public-ABI CPSE 1.0 repro; fixed C:\PsecRepro target.
    // Build: cl /nologo /std:c++17 /EHsc repro.cpp /Fe:psec-repro.exe
    #include <windows.h>
    #include <iostream>
    
    enum PROCESS_SECURITY_ENVIRONMENT_FLAGS : int {
      PROCESS_SECURITY_ENVIRONMENT_FLAG_NONE = 0,
      PROCESS_SECURITY_ENVIRONMENT_FLAG_TERMINATE_ON_CLOSE = 1
    };
    using HPROCESS_SECURITY_ENVIRONMENT = void*;
    using QueryFn = HRESULT (WINAPI*)(DWORD*); // documented 32-bit support-flags ABI; raw bits only
    using CreateFn = HRESULT (WINAPI*)(BYTE const*, DWORD, PROCESS_SECURITY_ENVIRONMENT_FLAGS, HPROCESS_SECURITY_ENVIRONMENT*);
    using CloseFn = VOID (WINAPI*)(HPROCESS_SECURITY_ENVIRONMENT);
    static void PrintHr(const char* n, HRESULT h) { std::cout << n << "=0x" << std::hex << static_cast<unsigned long>(h) << std::dec << "\n"; }
    
    // CPSE 1.0 (no 1.1 fields), root ProcessSecurityEnvironment, id PSEC, version 1.0,
    // fs_read_write=["C:\\PsecRepro"]; capabilities/read-only/deny/network omitted.
    static const unsigned char kSpec[] = {
      0x18,0x00,0x00,0x00,0x50,0x53,0x45,0x43,0x0e,0x00,0x0c,0x00,0x04,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
      0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,
      0x43,0x3a,0x5c,0x50,0x73,0x65,0x63,0x52,0x65,0x70,0x72,0x6f,0x00
    };
    
    int wmain() {
      static_assert(sizeof(DWORD) == 4, "support flags are 32-bit");
      HMODULE dll = LoadLibraryExW(L"processmodel.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
      if (dll == nullptr) { PrintHr("load", HRESULT_FROM_WIN32(GetLastError())); return 2; }
      auto query = reinterpret_cast<QueryFn>(GetProcAddress(dll, "QueryProcessSecurityEnvironmentSupport"));
      auto create = reinterpret_cast<CreateFn>(GetProcAddress(dll, "CreateProcessSecurityEnvironment"));
      auto close = reinterpret_cast<CloseFn>(GetProcAddress(dll, "CloseProcessSecurityEnvironment"));
      if (create == nullptr || close == nullptr) { PrintHr("exports", HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND)); FreeLibrary(dll); return 3; }
      if (query != nullptr) { DWORD support = 0; PrintHr("query", query(&support)); std::cout << "support_bits=0x" << std::hex << support << std::dec << "\n"; }
      else std::cout << "query=NOT_PRESENT\n";
      HPROCESS_SECURITY_ENVIRONMENT env = nullptr;
      HRESULT chr = create(kSpec, static_cast<DWORD>(sizeof kSpec), PROCESS_SECURITY_ENVIRONMENT_FLAG_NONE, &env);
      PrintHr("create", chr); std::cout << "spec_bytes=" << sizeof kSpec << " handle=" << (env != nullptr ? "nonnull" : "null") << "\n";
      if (SUCCEEDED(chr) && env != nullptr) close(env); else if (env != nullptr) std::cout << "close=SKIPPED_FAILED_CREATE\n";
      FreeLibrary(dll); return SUCCEEDED(chr) ? 0 : 1;
    }

    Actionable questions

    1. Which supported, non-mutating diagnostic identifies the access check behind Create's E_ACCESSDENIED when QuerySupport advertises support, including the independent unelevated/outside-job case above?
    2. Is there a known OS servicing fix or documented caller/specification prerequisite applicable to this Create boundary? Which exact caller/spec fields would be needed next, given that the original failure-time token/UBR were not recorded?

    We are keeping native execution disabled rather than treating a probe as proof of usable isolation or silently falling back.

  4. Max19970 commented on Nov 6, 2026

    @Max19970
    Author

    Issue #1648: correction to the direct-Create conclusion

    The earlier broad inference that direct CreateProcessSecurityEnvironment is unusable on this host was too strong. Operator-run controls now show a 61-byte CPSE 1.0 direct Create succeeding, while the SDK's 160-byte native CPSE 1.0 path still returns 0x80070005. The historical failure-time record remains as recorded; only the broader inference is corrected. The direct and SDK runs were not a same-process/same-caller control, so no cause is established.

    Operator-reported direct controls

    QueryProcessSecurityEnvironmentSupport returned 0x00000000 with raw support bits 0xf.

    Exact 61-byte spec, one RW path C:\PsecRepro, operator stdout:

    query=0x00000000 support_bits=0xf
    run1 C:\PsecRepro (exists): create=0x00000000 bytes=61 handle=nonnull closed=yes
    run2 C:\PsecRepro (exists): create=0x00000000 bytes=61 handle=nonnull closed=yes
    run3 C:\PsecRe333 (missing, same len): create=0x00000000 bytes=61 handle=nonnull closed=yes
    run4 битый спектр: create=0x8007000d handle=null
    

    The C:\ control is malformed, not a valid volume-root test: specWithPath() hard-codes the header path length at 12 while writing a 3-byte path, producing a 52-byte buffer with a mismatched header. Its 0x8007000d is therefore not evidence about valid root grants.

    The operator additionally reports S_OK for creation flags 0 and 1 (TERMINATE_ON_CLOSE), and for the 61-byte spec zero-padded to 160 bytes. These are reported results, not a reconstructed stdout transcript.

    Thus 160-byte size alone is insufficient to explain the SDK failure. Flags 0 and 1 also both succeed with the minimal spec.

    SDK path

    Operator-reported SDK debug: SDK 1.0.1, raw wire 1.0.0, native CPSE 1.0, 160 bytes, one RW path <RW_ROOT>, ui.disable: true, command cmd.exe /c echo PSEC_OK. --dry-run passed validation and selected base-container. The real run logged:

    process security environment spec built (PSEC 1.0, 160 bytes)
    failed to create the process security environment: CreateProcessSecurityEnvironment failed (HRESULT = 0x80070005)
    

    The same SDK path with fallback.allowDaclMutation:false and with fallback.allowDaclMutation:true both returned 0x80070005; no child ran. These are operator reports; we did not rerun them.

    No raw SDK 160-byte buffer was captured by us, and the offline encoder byte review is still pending. Until that byte-level comparison exists, no field or offset is claimed as the cause.

    Minimal SDK config used

    {
      "containment": "processcontainer",
      "fallback": { "allowDaclMutation": false },
      "filesystem": { "readwritePaths": ["<RW_ROOT>"] },
      "process": {
        "commandLine": "cmd.exe /c echo PSEC_OK",
        "cwd": "<RW_ROOT>"
      },
      "ui": { "disable": true },
      "version": "1.0.0"
    }

    The allowDaclMutation:true variant differs only in that fallback value and produced the same Create HRESULT.

    Actual 61-byte direct call

    This is the operator's Koffi Create/Close shape, one spec, flags 0:

    const koffi = require('koffi')
    const lib = koffi.load('C:/Windows/System32/processmodel.dll')
    const Query = lib.func('int32 __stdcall QueryProcessSecurityEnvironmentSupport(uint32_t *flags)')
    const Create = lib.func('int32 __stdcall CreateProcessSecurityEnvironment(const uint8_t *spec, uint32_t size, int32_t flags, void **env)')
    const Close = lib.func('void __stdcall CloseProcessSecurityEnvironment(void *env)')
    
    const SPEC = Buffer.from([
      0x18,0x00,0x00,0x00,0x50,0x53,0x45,0x43,0x0e,0x00,0x0c,0x00,0x04,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
      0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,
      0x43,0x3a,0x5c,0x50,0x73,0x65,0x63,0x52,0x65,0x70,0x72,0x6f,0x00,
    ])
    
    const q = Buffer.alloc(4)
    console.log('query', Query(q), 'bits', q.readUInt32LE(0))
    const env = Buffer.alloc(8)
    const hr = Create(SPEC, SPEC.length, 0, env)
    console.log('create', hr, 'bytes', SPEC.length)
    const h = env.readBigUInt64LE(0)
    if ((hr >>> 0) === 0 && h !== 0n) Close(h)

    Next measurement

    A same-process, same-caller baseline with flags 0 is sufficient; flags 0/1 are already ruled out as the differentiator. Run the exact 61-byte spec and the exact SDK-encoded 160-byte spec in that one process, capture both raw buffers and their hashes plus the decoded field trees, and compare before varying any single field.

    Questions

    1. Is the 61-byte CPSE 1.0 direct Create expected to succeed when Query reports support, independently of target-path existence?
    2. Which non-mutating diagnostic distinguishes a caller/token condition from a populated-spec/offset rejection at this Create boundary?

    Tracking: #1648

    Additional direct control in a different caller

    The operator's successful direct calls above remain valid. A later diagnostic under DSH's current workspace-write Tool caller used the same exact 61-byte spec, loaded C:/Windows/System32/processmodel.dll through Koffi, and obtained:

    Query: S_OK, support bits 0xF
    Create(61 bytes, flags=0): 0x80070005, environment=NULL
    

    The diagnostic stopped there: the reconstructed 160-byte buffer and all field-removal variants were not called. It therefore provides no evidence that any SDK field is the cause.

    A separate read-only Node process under that current Tool policy reports integrity S-1-16-4096 (Low), TokenElevated=0, TokenElevationType=3 (Limited), and IsProcessInJob=true. This is not a token capture from the preceding PSEC process. It was not used to elevate or change any token, job, file ACL, or label.

    The offline Rust/schema-derived reconstruction is 160 bytes, with one RW path, disallow_win32k_system_calls=true, ui_restrictions=0x3ff, and a present network_policy.egress whose default action is deny. Its actual Create result remains unmeasured here; the SDK's raw buffer was not captured, so byte identity is not asserted.

    This makes a controlled caller comparison necessary before blaming an encoded field. Is E_ACCESSDENIED an expected result for a Low-integrity caller of Create, and is the supported caller-integrity requirement documented?

  5. Max19970 commented on Nov 6, 2026

    @Max19970
    Author

    Follow-up: direct CPSE 1.0 buffers accepted; SDK ProcessContainer launch still fails

    This is a third follow-up and does not change the two earlier comments (#issuecomment-6674025945, #issuecomment-6675243575). The historical failure records remain as recorded.

    Operator-reported direct public-ABI results

    The same host ran our reconstructed 160-byte CPSE 1.0 buffer and all four field-removal variants through CreateProcessSecurityEnvironment + CloseProcessSecurityEnvironment. That variant runner calls only Create/Close, not QuerySupport, and launches no children. All five returned S_OK:

    full-sdk-160.bin                   bytes=160 create=0x00000000 OK
    without-disallow-win32k.bin        bytes=160 create=0x00000000 OK
    without-fs-read-write.bin          bytes= 80 create=0x00000000 OK
    without-network-policy.bin         bytes=128 create=0x00000000 OK
    without-ui-restrictions.bin        bytes=148 create=0x00000000 OK
    

    The reconstructed buffer is source-derived from the pinned SDK encoder fields: native CPSE 1.0, exactly one RW path <RW_ROOT>, UI mask 0x3ff, empty capabilities, and present network policy with deny-default egress. It is not claimed byte-identical to the SDK's actual output; the actual SDK raw bytes were never captured.

    SDK minimal still fails on the same host

    Operator-reported minimal SDK run: SDK 1.0.1, raw wire 1.0.0, native CPSE 1.0, 160-byte encoded spec, one RW path <RW_ROOT>, ui.disable: true, command:

    {
      "containment": "processcontainer",
      "fallback": { "allowDaclMutation": false },
      "filesystem": { "readwritePaths": ["<RW_ROOT>"] },
      "process": {
        "commandLine": "cmd.exe /c echo PSEC_OK",
        "cwd": "<RW_ROOT>"
      },
      "ui": { "disable": true },
      "version": "1.0.0"
    }

    The SDK dry-run passes validation and selects base-container. The real SDK run logs process security environment spec built (PSEC 1.0, 160 bytes), then Create returns 0x80070005. The same minimal run with fallback.allowDaclMutation: true also returns 0x80070005; neither run created a child. These are operator measurements; we did not rerun them.

    Separately, our DSH Tool's 61-byte baseline returned 0x80070005, and a separate current Tool-caller snapshot was Low integrity. This is not the operator's SDK result or a failure-time token capture.

    Public ABI note

    QueryProcessSecurityEnvironmentSupport takes a pointer to a 64-bit value (UINT64 *; pinned Rust *mut u64, secenv.rs#L110-L111). A 4-byte buffer is undersized even if only the low 32 bits are inspected. Any published repro should omit this Query or use an 8-byte UINT64 buffer. This is a general ABI caution and does not explain the SDK Create HRESULT.

    What this changes

    All tested direct CPSE 1.0 field variants are accepted by the OS on this host, including the full reconstructed 160-byte buffer. The remaining differential points investigation toward the SDK host-launch/preparation path at Create—the actual API arguments and bytes, loaded API/module, or caller context—rather than a simple rejection of these CPSE 1.0 fields. That is an investigation direction, not a proven root cause.

    The SDK failure is at Create, before attaching the security-environment process attribute or calling CreateProcessW. Those later steps were not reached and cannot explain this earlier HRESULT; a separate direct-launch prototype is not a successful SDK-launch measurement.

    Request

    Please compare the SDK runner's exact Create-boundary parameters/buffer and caller context with the successful ordinary-process direct call. A same-host trace at that boundary, including caller integrity/job context and loaded processmodel.dll, would distinguish an SDK argument/serialization difference from a calling-context requirement.

    Direct-launch prototype: additional caller-dependent result

    A single standalone Koffi prototype was then run under the ordinary DSH Tool caller, without SDK/wxc, QuerySupport, escalation, ACL/LABEL changes, or retries. It used the unchanged reconstructed 160-byte buffer. Actual stdout:

    {
      "create": "0x80070005",
      "envNonnull": false,
      "envOwned": false,
      "ungrantedRelationship": "parent",
      "children": [],
      "verification": null,
      "environmentClosed": false,
      "ownedChildUnsettled": false,
      "stop": "CREATE_FAILED"
    }

    No environment handle was acquired, so no Close was due. No pipe, process-attribute attachment, or CreateProcessW was reached; no cmd child was created and neither filesystem-write test ran. Unlike the earlier Tool control, this prototype makes no QuerySupport call, so its result does not depend on the earlier Query out-buffer sizing issue.

    The operator's ordinary-caller Create/Close successes above still stand. Taken together, the results establish that the calling context must be controlled before attributing this to a policy field or claiming a working replacement launcher. The earlier Low/in-job Tool snapshot remains a separate-process observation, not a token capture from this prototype. The precise SDK/ordinary-caller differential is not yet identified.

  6. Max19970 commented on Nov 6, 2026

    @Max19970
    Author

    Controlled comparison: the operator's unchanged script fails 5/5 in the Tool caller

    To remove differences between our launcher and the operator's direct ABI test, we ran the operator's original psec-bisect.cjs once, unchanged, using the requested NODE_PATH and the same Node 24.22.1 executable. No preload, wrapper inside Node, source change, spec re-encoding, or input substitution was used. The script itself reads the existing work/psec-repro/variants/*.bin files and calls only public CreateProcessSecurityEnvironment/CloseProcessSecurityEnvironment. No child payload is launched.

    Actual stdout under the ordinary DSH Tool policy:

    full-sdk-160.bin                   bytes=160 create=0x80070005 FAIL
    without-disallow-win32k.bin        bytes=160 create=0x80070005 FAIL
    without-fs-read-write.bin          bytes= 80 create=0x80070005 FAIL
    without-network-policy.bin         bytes=128 create=0x80070005 FAIL
    without-ui-restrictions.bin        bytes=148 create=0x80070005 FAIL
    

    The operator reports five S_OK results from this same script and these files in their ordinary terminal. Thus the Tool-side refusal is not specific to our direct-launch prototype. This comparison does not identify which caller property causes the refusal, nor does it explain the separate SDK CLI failure in the operator's terminal.

    Read-only current Tool-caller snapshot

    After that unchanged run exited, a separate process using the same Node executable and current Tool policy queried its own token and job state. This is not a failure-time capture from the original script's PID. No further PSEC call was made during this snapshot.

    Property Measured value
    Integrity Low, S-1-16-4096 / RID 4096
    IsProcessInJob true
    TokenRestrictedSids count 4
    IsTokenRestricted true
    TokenIsAppContainer false
    Elevated false
    Current thread impersonation token absent: OpenThreadToken returned ERROR_NO_TOKEN (1008)
    Effective token source in snapshot primary process token

    These are observations, not proof that Low integrity, restricting SIDs, or job membership individually causes the failure. No ACL/LABEL, token, privilege, product, or policy changes were made. No retry, broker, controller, or further PSEC experiment follows this comparison. Previous comments are preserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Backend-ProcessContainerIssue-BugOS-Windows

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions