FlGuardedInject is an exported C ABI on the shipped FrameLedger.Guard.dll.
Between that boundary and CreateRemoteThread the only thing ever asked of
`dllPath` was GetFileAttributesW — exists, and is not a directory. Measured
through the shipped binary with no test seam: C:\Windows\System32\winmm.dll
into a live process, verdict Allow, module present afterwards.
That is the standalone injector §S9 refused to ship, re-exported with a
published calling convention. Under 19_SAFETY's own threat model it is the
worst possible shape — an anti-cheat vendor auditing the binary finds a
general-purpose loader, and the rational response is to block FrameLedger.
Not a wrong assertion; a missing one, behind a scope sentence that read as
though it covered everything. fl_guard_abi.h says "there is no entry point
here that skips a check", which is true, and about the target. Every existing
test passed FL_OVERLAY_DLL as the payload and the one negative case used a
MISSING path, so the whole matrix exercised "is there a file there" and
nothing exercised "whose file is it".
The guard now establishes payload identity before it injects: the payload must
resolve — through symlinks, 8.3 names and junctions, via
GetFinalPathNameByHandleW — into the directory the guard's own code was loaded
from, compared by file id. Equality, not containment, reusing §S18's
OwnDirectory/SameDirectory, which until now existed only to RELAX this gate.
New seam Sources::PayloadIsOurOwn, new Reason::kPayloadNotOurs. A null seam and
a seam that cannot answer refuse the same way.
What it does not cover, stated rather than implied:
- It proves WHERE THE BYTES LIVE, not that they are FrameLedger.Overlay.dll.
Whoever can write to that directory can already replace the guard itself,
and we ship unsigned, so it is exactly as strong as the install location.
- It is not atomic with the load; the remote LoadLibraryW re-resolves.
- Absent stays kInjectionFailed. A damaged install and a misuse of the ABI
need opposite responses, so the existence test runs BEFORE the identity
test — otherwise "not ours" absorbs "not there", since the identity seam
works by opening the file.
Nothing shipped FrameLedger.Overlay.dll anywhere, and that had to be fixed in
the same change or the constraint would have been a gate that could not pass:
the native build left the payload in FrameLedger.Overlay/ while the guard built
into FrameLedger.Injector/, and dotnet publish produced an out/app with the
Agent, the guard and the rules seed but no payload at all.
FrameLedger.Overlay.targets now ships it beside the Agent (not the App, which
has no injector), and src/native/tests stages its own copy beside fl_guard_test
— through a target that depends on the Overlay rather than a POST_BUILD step,
so a rebuilt Overlay cannot leave a stale payload under test.
Proven red, green, and recovering. Three canaries — the refusal removed, a seam
failure treated as ours, a null seam allowed through — each turn fl_guard red.
The accepted direction is asserted separately, because a gate that refuses every
payload carries as much information as one that accepts every payload: the
staged Overlay must pass, the SAME FILE staged elsewhere must not, and the test
refuses to run at all if those two paths ever resolve to one directory.
Still open, recorded as §S22(b): the §S18 self-exemption asks about the scan-set
PROCESS, not about the module that matched. Any FrameLedger-family host that
does not sit beside FrameLedger.Guard.dll refuses its own injections with
SuspiciousUnsigned, naming our own DLL — measured, same binary, only the
caller's directory differing. Re-keying it on the matched module is strictly
narrower and fixes launch mode, but NameSink carries base names only, so the
module path never reaches the decision point; it needs the module seam widened
and the first-hit latch restructured, per §S19(b).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
57 lines
2.7 KiB
XML
57 lines
2.7 KiB
XML
<Project>
|
|
|
|
<!--
|
|
Ships FrameLedger.Overlay.dll beside the importing project's output.
|
|
|
|
§S22. The guard now refuses a payload that does not resolve into the
|
|
directory the guard's own code was loaded from — so the Overlay must LAND
|
|
there, or the constraint is a gate that cannot pass and the product refuses
|
|
its own injection.
|
|
|
|
Nothing copied the Overlay anywhere before this file existed. It was built
|
|
into build/native/x64-release/FrameLedger.Overlay/ and left there, so
|
|
`dotnet publish` produced an out/app containing the Agent, the guard and the
|
|
rules seed but no payload at all. That was invisible while the Agent had no
|
|
injector control, and it would have surfaced as an unexplained
|
|
kPayloadNotOurs the first time one was wired — which is the diagnosis §S22
|
|
warns is easy to misread as the guard being over-eager.
|
|
|
|
Imported by FrameLedger.Agent only, and for the same reason
|
|
FrameLedger.Guard.targets is: the Agent is the sole host of the guard (§S18
|
|
blocker 3, ratified). FrameLedger.App has no injector and must not carry a
|
|
payload it cannot use.
|
|
|
|
NOT imported by the native test suite. src/native/tests/CMakeLists.txt stages
|
|
its own copy beside fl_guard_test, because there the guard is compiled INTO
|
|
the test binary and "the guard's own directory" is the test's directory.
|
|
|
|
UNEXERCISED TODAY, stated rather than implied: the Agent builds no host, no
|
|
watcher and no injector control (Program.cs seeds the rules file and exits),
|
|
so nothing in a published build injects anything yet. This places the payload
|
|
where the gate will look when that lands; it does not make injection work.
|
|
-->
|
|
<PropertyGroup>
|
|
<FlNativeOverlayDir>$(MSBuildThisFileDirectory)build\native\x64-release\FrameLedger.Overlay\</FlNativeOverlayDir>
|
|
</PropertyGroup>
|
|
|
|
<ItemGroup>
|
|
<None Include="$(FlNativeOverlayDir)FrameLedger.Overlay.dll"
|
|
Condition="Exists('$(FlNativeOverlayDir)FrameLedger.Overlay.dll')">
|
|
<Link>FrameLedger.Overlay.dll</Link>
|
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
</None>
|
|
</ItemGroup>
|
|
|
|
<!--
|
|
Warn rather than fail, exactly as FrameLedger.Guard.targets does: build.ps1
|
|
runs the native build first, so by the time this evaluates the DLL exists. A
|
|
hard error would make `dotnet build` on a fresh clone fail for a reason that
|
|
has nothing to do with the managed code.
|
|
-->
|
|
<Target Name="FlWarnOnMissingOverlay" AfterTargets="Build"
|
|
Condition="!Exists('$(FlNativeOverlayDir)FrameLedger.Overlay.dll')">
|
|
<Warning Text="FrameLedger.Overlay.dll was not found at $(FlNativeOverlayDir). Run build.ps1 native first; the guard refuses a payload that is not beside it (§S22)." />
|
|
</Target>
|
|
|
|
</Project>
|