Skip to content

Security: Heritina-sys/ZKAPI

Security

SECURITY.md

Security policy

Reporting a vulnerability

Report privately — do not open a public issue.

Use GitHub's private vulnerability reporting: Report a vulnerability. If that is unavailable, contact the maintainer through their GitHub profile.

Please include the affected version or commit, reproduction steps, and what an attacker gains. A first response should arrive within 7 days.

Supported versions

Version Supported
master (unreleased)
Tagged releases ❌ — none published yet

Known issues in the current design

These are documented rather than hidden. Anyone deploying ZKAPI needs to know them before it faces a network.

1. No authentication or authorisation — unresolved

Program.cs calls app.UseAuthorization() but registers no authentication scheme, and no controller or action carries [Authorize].

Every endpoint is fully open. Anyone who can reach the port can read, create, modify and delete employee records, departments, and the complete attendance history — that is, biometric-derived records of when identifiable people entered and left a building.

Severity: high. This is the most serious open issue in the repository.

Mitigation until it is fixed: do not expose ZKAPI beyond a trusted network segment. Bind to localhost where possible, and place it behind an authenticating reverse proxy if it must be reachable.

2. Swagger published in all environments — unresolved

UseSwagger() and UseSwaggerUI() are called unconditionally, outside the usual IsDevelopment() guard. The complete API surface — every route, payload and model — is discoverable in production. Combined with issue 1, this hands an attacker the full map.

3. Database credentials were committed — remediation incomplete

ZKAPI/appsettings.json contained a live connection string:

server=localhost;port=3306;database=att;user=root;password=root
Exposed 13 May 2026 → 7 September 2026, in a public repository
Copies 6 tracked paths — the source file plus five build-output duplicates under bin/ and obj/
Status Removed from HEAD on 7 September 2026. Still present in git history.

Removing a secret from HEAD does not unpublish it. The value remains reachable by commit SHA, and in any clone, fork or cache made while it was public.

Required follow-up:

  1. Rotate the MySQL password. Treat root/root as compromised. This is the only step that actually resolves the exposure — the rest is cleanup.
  2. Purge the value from history with git filter-repo, then force-push. This rewrites every commit SHA and requires every clone to be re-cloned.
  3. Never grant the API a root account. Create a dedicated user limited to the att database.

4. Local Visual Studio state was committed — resolved

.vs/ was tracked, including .suo, applicationhost.config, design-time build caches, and Copilot semantic indices (CodeChunks.db, SemanticSymbols.db) containing indexed source. Untracked on 7 September 2026 and now covered by .gitignore. Still present in history.

5. No transport security between components — by design, environment-dependent

ZUtility pushes to ZKAPI over plain HTTP (http://localhost:5159). On a single host this is fine. If the collector and API are ever split across machines, attendance data crosses the network unencrypted.


Data protection note

This system processes personal data: employee names, and biometric-derived timestamps establishing an identifiable person's physical presence. Depending on jurisdiction, that is likely to be regulated — including obligations around retention limits, access control, and the lawful basis for collection.

Nothing in this repository implements those obligations. There is no retention policy, no audit log, no access control (see issue 1), and no anonymisation path. This is stated so that it is a known gap and not an assumption.


Reporting scope

In scope: authentication and authorisation flaws, injection, data exposure, dependency vulnerabilities with a practical path to exploitation.

Out of scope: the issues already listed above (report new findings), and anything requiring pre-existing access to the host or database.

There aren't any published security advisories