Skip to content

Security: HugoSabater/antimalware-core

Security

SECURITY.md

Security Policy

Supported Versions

This project is under active development. Only the latest commit on main is supported.

Branch Supported
main ✅
Any tagged release ✅
Older branches ❌

Reporting a Vulnerability

Do NOT open a public GitHub issue for security vulnerabilities.

If you discover a security vulnerability in antimalware-core, please report it privately:

  1. Open a GitHub Security Advisory on this repository.
  2. Include a clear description of the vulnerability, the affected component, and steps to reproduce.
  3. Allow up to 72 hours for an initial response.

Security Architecture

The security model of this project is formally documented in two files:

  • AGENTS.md — Interaction rules, dependency policy, and hard limits.
  • BRAIN.md — Architectural Decision Records (ADR log) and known threat mitigations.

Key Principles

1. All IPC Clients Are Treated as Hostile

The Named Pipe server at \\.\pipe\antimalware_core_ipc enforces a layered validation chain before processing any message:

  1. T1 — Anti-squatting: FILE_FLAG_FIRST_PIPE_INSTANCE ensures only the service can hold the pipe.
  2. T2 — DACL: Restrictive ACL allows only SYSTEM and INTERACTIVE principals.
  3. T3 — Remote block: PIPE_REJECT_REMOTE_CLIENTS prevents SMB-based access.
  4. T4 — Size limit: 8 KB maximum payload, validated before memory allocation.
  5. T5 — Process identity: Client's executable path is verified against a hardcoded whitelist via GetNamedPipeClientProcessId → QueryFullProcessImageNameW.

2. Dependency Hygiene

  • Zero unaudited external crates. Every dependency is listed in BRAIN.md with maintainer, license, and surface-of-attack evaluation.
  • Preference hierarchy: Win32 native API → Microsoft crates (windows-rs) → audited community crates.
  • cargo audit must pass before any dependency change is merged.

3. unsafe Rust Policy

Every unsafe block must have a // SAFETY: comment that explicitly justifies why the invariants upheld by the compiler are maintained manually. This is enforced during code review.

4. Quarantine ACL Design

Files in the quarantine vault (C:\ProgramData\AntimalwareCore\Quarantine\) use a protected DACL (inheritance disabled) with:

  • ALLOW NT AUTHORITY\SYSTEM: GENERIC_ALL
  • ALLOW BUILTIN\Administrators: GENERIC_ALL
  • All other principals: implicit deny

A DENY Everyone ACE is intentionally avoided. Everyone (S-1-1-0) includes SYSTEM; placing a DENY ACE for Everyone after the ALLOW SYSTEM ACE would still deny SYSTEM, because Windows evaluates ACEs sequentially and an ACCESS_DENIED_ACE for a matching SID immediately terminates access checks.


Out of Scope

The following are not security vulnerabilities in the context of this project:

  • Behaviors that require the attacker to already have SYSTEM or Administrators privileges.
  • Denial of service via resource exhaustion on the scanning host (the scanner is designed to be cancelled).
  • Issues in third-party dependencies (report to the respective upstream project; we will update our dependency).

There aren't any published security advisories