Skip to content

PostgreSQL Unsigned binary is blocked by Smart App Control #192

Open

Description

@OWar77

Platform

Windows

Flock version

1.0.0

OS version

Windows 11 Build 26H2

What happened?

Description

Full-text search on a Flock-managed PostgreSQL instance fails with SQLSTATE[58P01] because Windows cannot load lib/postgresql/unaccent.dll. The DLL is not corrupted and the unaccent extension is correctly installed — Windows Code Integrity refuses to load it because the binary is unsigned and Smart App Control (SAC) is running in enforcement mode.

The problem is not limited to unaccent.dll. The same policy also blocks other unsigned binaries shipped with Flock (php_redis.dll, meilisearch.exe), so other services are affected as well.

Error

SQLSTATE[58P01]: Undefined file: 7 ERROR: could not load library
"%APPDATA%\Flock\services\postgres\18.6-build2\lib\postgresql\unaccent.dll":
An Application Control policy has blocked this file.

(Paths anonymized. Triggered by any full-text search query using websearch_to_tsquery() / to_tsquery() with a text-search configuration that uses the unaccent dictionary. Query and schema details intentionally omitted.)

Environment / versions

Component Version
Flock 1.0.0 (daemon)
PostgreSQL 18.6 — Flock build 18.6-build2
PHP 8.5.12 (ZTS, Visual C++ 2022 x64)
Meilisearch 1.56.1
Windows 11, build 26300.9974 (26H2)

Additional context:

  • Machine is not domain-joined or Azure AD-joined — this is a local Smart App Control policy, not an enterprise policy.
  • Avast Antivirus is installed and registered in Windows Security Center; Microsoft Defender real-time protection is passive, as expected. The antivirus is not the component blocking the file.

Evidence

Event Viewer → Applications and Services Logs → Microsoft → Windows → CodeIntegrity → Operational:

Code Integrity determined that a process
(%APPDATA%\Flock\services\postgres\18.6-build2\bin\postgres.exe) attempted to load
%APPDATA%\Flock\services\postgres\18.6-build2\lib\postgresql\unaccent.dll that did not
meet the Enterprise signing level requirements or violated code integrity policy
(Policy ID:{0283ac0f-fff1-49ae-ada1-8a933130cad6}).

Event IDs: 3077 and 3033, repeating on every attempt.

Policy {0283ac0f-fff1-49ae-ada1-8a933130cad6} is Microsoft's inbox VerifiedAndReputableDesktop policy — the policy used by Smart App Control.

Additional checks:

  • Get-AuthenticodeSignature ...\unaccent.dll → NotSigned
  • No Zone.Identifier alternate data stream → not a Mark-of-the-Web / "unblock file" issue
  • HKLM\SYSTEM\CurrentControlSet\Control\CI\Policy\VerifiedAndReputablePolicyState = 1 (enforcement)
  • VerifiedAndReputablePolicyStateMinValueSeen = 1 (SAC was never in evaluation mode on this install)
  • Other blocked binaries: %APPDATA%\Flock\php\8.5\ext\php_redis.dll, %APPDATA%\Flock\services\meilisearch\1.56.1\meilisearch.exe
  • All affected binaries have unchanged creation/modified timestamps, so this is not a bad or partial download. The same setup worked a few days earlier; the first block events appear when those binaries are first loaded, which points to a change in Microsoft's cloud reputation verdict rather than a file change.

Expected behavior

PostgreSQL should be able to load its contrib extension DLLs so full-text search works on Windows 11 with default security settings, including when Smart App Control is enabled.

Suggested fix

Sign the distributed binaries with a valid code-signing certificate — at minimum lib/postgresql/*.dll, php/ext/*.dll, meilisearch.exe and flock.exe — or ship/use an officially signed PostgreSQL build. Microsoft's own guidance for ISVs is: "sign your app with a valid certificate". Since Smart App Control offers no per-app exception mechanism (confirmed in Microsoft's FAQ), signing is the only permanent solution that keeps SAC enabled.

Steps to reproduce

  1. Install Flock on Windows 11 with Smart App Control set to On (enforcement).
  2. Set up a text-search configuration that uses the unaccent dictionary.
  3. Run a full-text search query using websearch_to_tsquery() / to_tsquery().
  4. The query fails with SQLSTATE[58P01]; Code Integrity logs events 3077/3033.

Logs


Metadata

Metadata

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions