COMING SOON · PROPOSALsecurity/yaza-security-review-proposal.md
Status dokumen bukan klaim bahwa fiturnya sudah tersedia.

RFC dan proposal mencatat rancangan. Untuk kemampuan yang benar-benar dapat dipakai, lihat matriks kapabilitas runtime dan catatan rilis.

YAZA Security Assurance Proposal

Status: Integrated proposal; implementation and operational commitments are tracked separately
Baseline review: 2026-10-28
Scope: YAZA compiler and CLI, generated C and native programs, API runtime, PostgreSQL clients, standard library, templates, editor tooling, CI, release artifacts, and supported targets.

Executive summary

YAZA has useful security controls in its current prototype: bounded HTTP and JSON parsing, request and connection limits, checked database parameter binding, explicit route authentication modes, safe error envelopes, filesystem-root APIs, secret types with explicit zeroization, compiler hardening flags, sanitizer harnesses, parser fuzzing, and a tested macOS API path. These controls protect particular code paths and configurations. They do not make the language, compiler, generated native binaries, or applications memory-safe or production-secure.

The source tree still emits C. Arbitrary YAZA programs run with the host user's privileges, and yaza test is not an operating-system sandbox. API object and tenant authorization, inbound TLS, Linux end-to-end evidence, a unified PostgreSQL security policy, package provenance, and a private vulnerability-reporting process are incomplete. Generated API route handlers and database calls execute on a bounded worker pool; the event loop owns sockets, health, metrics, and response writes. Blocking calls occupy workers until they return, cancellation is cooperative, and language-level async tasks and multi-worker scheduling remain unimplemented. If a handler remains active after the configured shutdown grace, the API process exits with failure rather than forcibly cancelling its thread. On macOS, the .env loader hardening and reduced child environment for Clang now pass focused checks within the local self-host bootstrap; the ordinary process, process_capture, and timeout APIs still inherit the parent environment unless callers choose an allowlist API.

The attached additions are incorporated below, with findings reclassified against the newer source and status files. Several claims in the attachment are stale or require reproduction. For example, the response writer now queues ordinary API responses and the scheduler already has deterministic tests; the reported 1,024-byte response-header limit is now 4,096 bytes. The Linux epoll listener-event mismatch has a source fix and a regression assertion in the native readiness harness. The harness passed locally on macOS under ASan/UBSan, but that exercises kqueue; Linux epoll and end-to-end API behavior remain unverified until the Ubuntu workflow and a Linux API smoke pass.

No finding in the attached additions is a confirmed CVE or a reproduced remote-code-execution exploit. This review did not run a penetration test or the Linux/API/PostgreSQL test matrix. A CVE is a public identifier for a disclosed vulnerability, not a certification that a product passed security testing. No process can guarantee that software has zero vulnerabilities. YAZA can instead define a bounded assurance profile and require repeatable evidence before making a claim or release.

2026-10-28 implementation evidence update: The complete macOS arm64 bootstrap now passes after environment hardening, including three self-hosted compiler stages, the 45-test YAZA language suite, sanitizer harnesses, 10,000 deterministic ASan/UBSan fuzz cases, API authentication and dotenv smokes, and the remaining local API checks. process_env, process_timeout_env, and process_capture_env now start children with only explicitly supplied entries; the process test confirms exact captured variables, no ambient secret leakage, timeout termination, rejection of dynamic-loader and unsafe PATH entries, and bounds on argument/environment list sizes. JSON diagnostic checks confirm that explicitly allowlisted diagnostic metadata still works. Legacy process APIs still inherit the parent environment. For the shared-token overlap change, the API route-auth smoke was additionally run normally and under ASan/UBSan. These results apply to this macOS checkout and toolchain only. Hosted Linux CI, remote TLS, sandbox escape tests, and independent review remain open.

2026-10-28 repository audit scan: I reran ./dist/yaza audit --security --format json from the repository root for this update. The latest run scanned 358 relevant files and returned 15 heuristic findings (five possible-secret matches and ten TLS-verification matches); candidate values were omitted, and exit status 1 means findings were reported. Context review confirmed that the compiler/native_cli.yz candidate is the analyzer's own SARIF rule description, not a credential. The remaining possible-secret matches are synthetic test credentials; the TLS matches are in test fixtures or local-development .env.example files. They do not establish a production secret or production TLS downgrade. Keep test credentials synthetic and local plaintext examples explicitly loopback-only. The analyzer has no dependency-advisory, taint, or runtime analysis and can miss or misclassify findings. Fifteen is not a CVE count, and this scan cannot establish that the repository is clean. This workspace has no Git HEAD commit and the YAZA tree is uncommitted/untracked, so the result is tied to this workspace snapshot rather than an immutable release revision. No smoke, sanitizer, fuzz, or API suites were run for this documentation/status update.

2026-10-28 security status snapshot: Appendix H records 2 of 18 sections as implemented, 11 as partial, 4 as not implemented, and H.18 as an accepted design direction whose implementation is pending. These are section labels, not a weighted security score. The candidate register contains 13 P1-ranked follow-ups; that count includes incomplete evidence and product gaps, not 13 confirmed vulnerabilities. This review has not reproduced an RCE or confirmed a P0 issue, which does not establish that none exists. The latest recorded macOS evidence includes stricter .env handling, explicit child-process environments, exact Host allowlisting, stronger shared-token defaults and a token generator, fatal UBSan fuzzing, and HTTP 405 Allow headers. The most consequential release gaps remain the absence of an OS sandbox for untrusted projects, incomplete memory-safety and secret-lifetime guarantees, missing object/tenant authorization and inbound TLS, synchronous route/database work, incomplete Linux end-to-end evidence, supply-chain provenance, and an active private vulnerability-reporting process. The audit was rerun for this snapshot; no test suites were rerun in this documentation update, and earlier test/platform limits remain authoritative. The current workspace does not have an immutable Git commit, so this status cannot yet be treated as release evidence.

1. Scope, assumptions, and evidence

1.1 Scope and exclusions

The assessment covers the YAZA implementation and its documented release path. Application-specific authorization rules, the host operating system, PostgreSQL deployment, reverse proxy, cloud account, and operator configuration remain part of the security boundary.

This proposal is not a source audit by an independent security firm, cryptographic review, penetration test, certification, or legal assessment. Existing test results cited here are repository records; they were not all rerun for this document. Source observations must not be represented as reproduced vulnerabilities.

1.2 Evidence labels

Label Meaning
Tested for named path A repository test or recorded run covers the exact feature, version, platform, and configuration stated. It does not generalize to other targets.
Source-observed; unconfirmed A code path appears to have the behavior described, but a controlled reproduction or test is still needed.
Hypothesis A plausible abuse scenario that still needs a minimal reproduction and impact assessment.
Not implemented The source or status matrix records that the capability or process is absent.
Proposed control A requirement for future implementation; it is not present merely because it appears in this document.

A closure record must include the finding ID, affected and fixed versions, source revision, OS and architecture, compiler/tool versions, reproduction or test command, test output or CI URL, remaining limitations, reviewer, and closure date. Release-specific evidence expires when the relevant source, dependency, toolchain, or target changes.

1.3 Risk priorities

These are engineering priorities, not CVSS scores.

Priority Criteria Release treatment
P0 A credible path to unauthenticated code execution, cross-tenant compromise, or a fundamental breach of the advertised security boundary in a supported default configuration. Stop the affected release; isolate, reproduce, fix or disable the vulnerable feature, and publish coordinated guidance.
P1 A credible path to serious data exposure or modification, authentication/authorization bypass, remote denial of service, or host compromise with stated prerequisites. Fix or disable before public production use of the affected profile.
P2 Defense-in-depth, availability, compatibility, evidence, privacy, or future-feature risk without a demonstrated P0/P1 path. Track with an owner and target milestone; do not silently claim it is closed.

No P0 is confirmed by this review. That means only that the current review did not confirm one; it does not establish that none exists.

1.4 Review of the supplied security additions

The supplied yaza-security-proposal-additions.md is a useful source-review checklist. Its author labels the candidates as unreproduced, and this proposal preserves that distinction. The current repository and recorded test evidence change several of its conclusions:

Addition Updated assessment
SEC-R01 Linux epoll listener dispatch A source fix and listener-event regression assertion now exist. The assertion passed on macOS through kqueue; Linux epoll, hosted Ubuntu execution, and Linux API end-to-end behavior remain unverified. Keep the target gate open.
SEC-R02 any runtime error exits the service Too broad as stated. Native fatal paths exist, but request reachability and process-wide impact have not been reproduced. Audit route-reachable failure paths and test a controlled recoverable failure.
SEC-R04 slow response reader blocks every connection Stale for the normal API response path: writes are queued, bounded, and resumed on writable events, with a slow-reader fairness harness. Audit the remaining synchronous fallback for reachability.
SEC-R07 1,024-byte response-header buffer Stale: the current limit is 4,096 bytes. Route-specific Allow headers are now emitted for 405 responses, and route methods are validated as bounded HTTP tokens. The API HTTP smoke covers collection, item, and operational routes in normal and ASan/UBSan builds on macOS. Header-size boundary behavior and Linux verification remain open.
SEC-R09 loopback DNS rebinding An exact YAZA_ALLOWED_HOSTS policy is implemented and covered by the macOS API HTTP smoke. Loopback defaults to 127.0.0.1, localhost, and the configured loopback address; a non-loopback bind without an explicit list is rejected before listening. Wildcards, ports in configuration, malformed hosts, and hosts outside the list are rejected. The request port is ignored. This closes the direct Host-header allowlist gap for the tested path, but no browser DNS-rebinding exploit/reproduction or Linux test is recorded.
SEC-R12 one-byte API tokens A 32-byte minimum, yaza secret token CSPRNG generator, and two-slot shared-token overlap now have local smoke evidence. Central revocation and per-user token lifecycle remain absent; a minimum length does not prove entropy.
SEC-E01 unsafe .env file and loader settings File type, owner, permissions, no-follow behavior, size, NUL, and reserved-key checks are implemented and smoke-tested on macOS arm64. Cross-platform and production-mode evidence remains open.
SEC-E02 inherited child environment Explicit-environment APIs and argument/environment bounds now exist and have local tests. Legacy process APIs still inherit the parent environment; neither API family is an OS sandbox.
SEC-B03 generated-C string injection The generator encodes quotes and backslashes as octal; one say formatting path rejects backslash escapes. This does not prove all source and metadata inputs safe. No exploit is reproduced. Adversarial tests for control bytes, metadata, identifiers, and every C-generation boundary remain required.
SEC-F01 UBSan findings do not fail fuzzing Both fuzz modes now make UBSan fatal; a signed-overflow probe and a local 10,000-case macOS sanitizer run pass. Hosted Ubuntu/libFuzzer evidence remains pending.
SEC-F04 CI only supports macOS Stale as a configuration claim: a Linux runtime sanitizer/fuzz workflow exists. Hosted execution, branch protection, and Linux compiler/API/PostgreSQL end-to-end coverage are still unverified.
SEC-S01 scheduler has no tests Stale: deterministic tests cover task capacity, timers, wake, joins, cancellation, cleanup, and handle reuse. Language-visible async, multi-worker execution, and race-safety evidence are still absent.

Other source observations in the additions remain candidates or design risks unless a test or controlled reproduction is linked. In particular, synchronous route/database work, absent object/tenant authorization, incomplete memory-safety semantics, lack of an OS sandbox for untrusted projects, absent inbound TLS, PostgreSQL policy drift, and missing release provenance/private vulnerability intake remain substantial gaps. The full candidate register below is the maintained record; this reconciliation does not promote an unverified observation to a confirmed vulnerability.

2. Threat model

2.1 Assets

  • YAZA source, compiler, generated C, native executables, and release artifacts.
  • Application records, PostgreSQL credentials, API tokens, signing/provenance material, and personal data.
  • Developer and CI files, environment variables, build tools, and process privileges.
  • API availability, integrity of HTTP/database operations, and correctness of generated API documentation.
  • Package identity, lock data, dependency versions, editor extension, and update path.

2.2 Actors

Actor Assumed capability
Anonymous network caller Sends arbitrary HTTP bytes, malformed/slow requests, and high request volume to an exposed API.
Authenticated malicious caller Uses a valid credential to probe object-level authorization, business-flow limits, and resource bounds.
Untrusted project or package author Supplies source, tests, manifests, build metadata, or templates that a developer compiles or runs.
Compromised dependency, editor extension, or build tool Changes compiler inputs, generated code, or release output.
Compromised CI/release identity Reads secrets or publishes modified artifacts.
Insider or compromised host process Reads files, environment, logs, backups, or process memory allowed by its OS identity.
Future automated coding agent Relevant only if YAZA later ships an agent that reads source or invokes privileged tools.

2.3 Trust boundaries

  1. .yz source and project metadata enter the compiler, C generator, and native build tools.
  2. An HTTP peer's bytes pass through framing, parsing, authentication, route policy, application handlers, and database access.
  3. YAZA programs access host files, environment, network, and child processes through native runtime calls.
  4. PostgreSQL credentials and data cross a client, network, TLS provider, server, migration, and backup boundary.
  5. Dependencies and build artifacts cross the local checkout, CI identity, release pipeline, installer, and user's machine.
  6. macOS evidence does not establish Linux, Windows, WASI, browser, edge, Android, or iOS security.

3. Existing controls and their limits

The following inventory summarizes controls documented in the current source/status files. It is not a fresh test report.

Area Current control recorded Important limit
HTTP and JSON Bounded headers/body, strict framing, duplicate framing rejection, bounded chunks/trailers, JSON depth and field limits, UTF-8 validation, and request deadlines. No differential HTTP parser campaign is recorded; Linux listener behavior needs end-to-end verification.
HTTP availability Connection cap, keep-alive limits, request deadline, bounded response queues, writable-event response flushing, and shutdown drain. Handlers and database operations still run synchronously; process-wide CPU/RSS/file-descriptor limits are not enforced by the runtime.
API authentication Explicit public, shared Bearer, and HS256 JWT route policies; fixed-time token comparison; JWT claim verification and bounded request-scoped claim storage. Shared API tokens have a 32-byte minimum and support two-slot overlap for rolling rotation. No typed principal, roles, object/tenant ownership policy, user token issuer, central revocation, JWT signing-key rotation, OIDC/JWKS, or inbound TLS. The minimum length does not measure entropy or protect against a predictable 32-byte human-chosen token.
API response and logs Safe typed error envelopes, request IDs, hardened response headers, access logs omit query strings, and name-based redaction exists. A single error contract is incomplete; name-based redaction is heuristic and may miss secrets or personal data.
PostgreSQL Bound parameters, pure-YAZA SCRAM-SHA-256 modules, bounded frames, TLS verification paths, database timeouts on a documented API path, migration checksums, and connection-pool work. Live remote TLS interoperability and Linux verification remain incomplete. Multiple client paths need one conformance policy; cancellation and full transaction/row typing remain partial.
Memory and secrets Bounded program/request/task arenas, explicit SecretText and Bytes wipe operations, scoped cleanup in selected paths, and sanitizer harnesses. Ordinary arena reset/free do not wipe all copies. The language has no complete ownership/lifetime safety proof; generated C remains in the trusted computing base.
Filesystem Rooted filesystem operations use component-wise no-follow opens and bounded paths; temporary cleanup has ownership, mode, depth, and entry limits. yaza test working-directory isolation is not an OS sandbox; the full filesystem API and cross-target behavior are incomplete.
Compiler/build PIE, stack-protector, fortified-library and format-security flags are recorded; --sanitize adds ASan/UBSan. Three-stage macOS bootstrap has recorded identical consecutive generated C. These controls are not memory-safety proofs. Hosted CI execution, branch protection, reproducible independent builds, SBOM, provenance, trusted publishing, and package verification remain incomplete.
Fuzz/scheduler Runtime HTTP/JSON parser fuzzing and a Linux GitHub Actions sanitizer/fuzz workflow are configured. Both fuzz build modes now use fatal UBSan; a signed-overflow probe verifies that undefined behavior stops execution, and a local deterministic ASan/UBSan run replayed six seeds and completed 10,000 mutations. Scheduler-core tests cover bounded deterministic task operations. The local run used the macOS deterministic fallback, not Linux libFuzzer. Hosted Ubuntu execution and branch protection remain unverified; fuzz scope is narrow. Multi-worker scheduling and race semantics are not implemented.
Cryptography OS-backed randomness, constant-time byte comparison, Argon2id and selected standard primitives are present. SCRAM/RFC primitive vectors are recorded. Provider behavior and TLS need per-target evidence; secret copies are not automatically erased; caller-controlled work factors and salts need safer APIs and policy.

3.1 Source review traceability

These are direct source observations, not exploit confirmations. They identify the boundaries that the test record must cover and the limits that should remain visible in product claims.

Boundary Source reviewed What the source does Security interpretation
C generation and module loading native_cli.yz resolves imports and c_string_literal quotes generated C strings. Imports are constrained by module-name checks and resolved using source-relative paths or configured standard-library roots. The C literal encoder escapes quotes and backslashes. No exploit is confirmed. This is a compiler trust boundary; adversarial tests must cover controls, Unicode, metadata, paths, and every generator sink. Project files and the selected toolchain remain trusted inputs.
Child processes yaza_runtime.c.inc uses fork/execvp; explicit-environment validation and execution are at lines 3539–3695. Commands are passed as an argument vector; there is no implicit shell parsing. New explicit-environment variants bound argument/environment sizes and reject selected loader variables, while legacy variants inherit the parent environment. This prevents shell-string interpolation only when callers use argv safely. A YAZA program can still run arbitrary host commands with the host user's file, network, and process privileges; no command allowlist or OS sandbox exists.
HTTP parser and Host validation yaza_http_read_request and yaza_http_host_allowed. The parser bounds headers/body, rejects duplicate framing and selected sensitive headers, and enforces an exact configured Host list. The source has defensive checks, but only macOS end-to-end evidence is recorded. A Host allowlist is not authentication, CSRF defense, CORS, or transport encryption.
JWT authentication yaza_http_jwt_authenticated and API startup configuration at lines 10302–10459. The verifier accepts HS256 only, pins issuer/audience, requires expiry, checks optional nbf/iat, compares the MAC in fixed time, and wipes temporary buffers. sub is optional; there is no issuer, revocation list, rotation, or role/ownership engine. A valid JWT proves possession of a shared signing key and accepted claims; it does not prove application identity or authorization policy. Treat this as a bounded token-validation feature, not a complete identity system.
Filesystem capability Root acquisition and component traversal are in yaza_runtime.c.inc and lines 2883–3050. Rooted reads/replacements walk with openat and no-follow flags, cap paths/bytes, and use a private same-directory temporary file for replacement. The root is selected by the program and provides a capability boundary only for calls using that API. General file and process APIs still have host-user authority; yaza test is not a sandbox.
Memory and secrets Arena accounting is in yaza_runtime.c.inc; secret reveal/wipe paths are at lines 1913–1933. YAZA-managed allocations can be budgeted; explicit secret and byte zeroization uses a volatile wipe. Arena budgets do not cap total process RSS, native allocations, stack, mapped files, libraries, or child-process use. Revealing a secret as ordinary Text can create copies outside the wiped secret buffer.
Network, TLS, and URL safety Client TLS code is in yaza_runtime.c.inc; URL-parser scope is stated in url.yz. PostgreSQL remote transport requires verified TLS in the documented path. The URL parser validates syntax but does not resolve DNS or authorize destinations. Inbound API TLS is absent. If outbound fetch/webhook/package features are added, URL syntax checks alone will not prevent SSRF, DNS rebinding, redirects to private addresses, or cloud-metadata access.
HTML output html.yz escapes text/quoted attributes and applies a narrow HTTPS/relative-href policy. It rejects invalid UTF-8 and bounds inputs; it does not parse or sanitize rich HTML. Do not treat these helpers as JavaScript, CSS, SVG, or rich-HTML sanitizers. Context-safe output remains the application's responsibility outside the covered contexts.

No source-only row above is a confirmed remotely exploitable vulnerability. A finding becomes confirmed only after a controlled reproduction or a narrowly scoped test establishes the claimed behavior and impact.

4. Candidate finding register

Findings below retain IDs from the supplied additions. Statuses are deliberately conservative: source review is not a vulnerability reproduction. “Confirmed behavior” means a code/configuration fact, not a confirmed exploit.

4.1 HTTP runtime and availability

ID Priority Latest assessment Required follow-up
SEC-R01 P1 Source fix applied; Linux verification pending. The I/O driver records the listener descriptor for token 0, and the epoll adapter returns that descriptor in the event. tests/io_backend.c now asserts listener event identity; the harness passed locally on macOS with ASan/UBSan, which exercises kqueue rather than epoll. Run the existing Ubuntu runtime-security harness and a Linux API health/CRUD/shutdown smoke; measure idle CPU. Keep Linux API support unclaimed until this gate passes.
SEC-R02 P1 Conditional process-wide failure risk. Native runtime failure helpers can exit the process; not every such path is reachable from a request. No request-triggered reproduction is recorded. Enumerate error/panic paths reachable from route values. Return typed errors for recoverable faults; contain defined request panics, clean request resources, and prove the server continues. Never recover from memory corruption or undefined native state.
SEC-R03 P2 Empty request EOF is now handled without a false HTTP error. If a peer closes before sending any request bytes, the runtime resets its connection before assigning a request ID, emitting an access log, or recording an HTTP response. The low-RLIMIT_NOFILE integration closes a queued client before acceptance and verifies that the 400 response metric remains zero; normal, ASan/UBSan, and ThreadSanitizer harness runs pass on macOS. Raw-TCP tests now verify normal request completion followed by SHUT_WR, partial-header and partial-body EOF responses, exact 400 response metrics, connection cleanup, and corresponding access logs; normal, ASan/UBSan, and ThreadSanitizer harness runs pass on macOS. Linux protocol behavior remains unverified. Run the same raw-TCP EOF matrix against the Linux epoll backend and verify response, request/response metrics, access logs, and connection cleanup there.
SEC-R04 P2 Original P1 claim is stale for ordinary API responses. The active response path queues bounded output and resumes on writable events. A synchronous fallback helper remains and should be audited for reachability. Keep the existing slow-reader regression; prove all serving paths use the queued writer or bound any fallback.
SEC-R05 P2 Event-loop isolation is implemented; worker starvation remains possible. Generated route handlers and PostgreSQL-backed readiness run on a bounded worker pool, with independently configurable in-flight admission, deadlines, cooperative cancellation, and a fixed 503 when saturated. Pool acquisition plus native TCP/TLS readiness waits observe cancellation in slices of at most 50 ms. The event loop retains socket ownership and can continue health/metrics service. Synchronous DNS, a query or TLS-provider call already in progress, or a non-cooperative handler can still occupy a worker; live PostgreSQL saturation, Linux behavior, and load/soak limits remain unverified. Add slow-database and CPU-bound handler tests, verify overload/recovery and shutdown under sustained load, record live PostgreSQL overlap and Linux results, and implement language-visible suspendable async I/O before promising nonblocking database execution.
SEC-R06 P2 Connection-capacity and process descriptor-exhaustion behavior are implemented and locally verified. At the configured connection cap, excess accepted clients are closed without parsing or an HTTP response, and yaza_http_connections_rejected_total records them. The loopback test verifies the active client can still serve metrics and the listener accepts new traffic after a slot opens. A second integration lowers RLIMIT_NOFILE, triggers real EMFILE from accept(), observes yaza_http_accept_backoffs_total, releases descriptors, verifies the one-second pause/re-registration and health recovery, and confirms an empty queued peer close does not add a false HTTP 400. Normal, ASan/UBSan, and ThreadSanitizer harness runs pass on macOS. System-wide ENFILE and Linux epoll/API behavior remain unverified. Verify system-wide ENFILE behavior where practical and run Linux epoll/API overload checks. Keep the no-response close behavior documented as the connection-capacity policy.
SEC-R07 P2 The reported 1,024-byte buffer is outdated; the current response header buffer is 4,096 bytes. Runtime 405 responses include path-specific Allow; ordinary OPTIONS returns a bodyless 204 for a known path, OPTIONS * returns the server-wide method set, and an unknown path returns 404. Allow includes implicit HEAD for GET and OPTIONS. Built-in health, readiness, and metrics paths advertise GET, HEAD, OPTIONS. Discovery reuses the strictest matching route auth policy, including JWT; CORS preflight still validates the requested method and headers. The full HTTP smoke passes normally, and route-auth smoke passes normally and under ASan/UBSan on macOS. Route methods are validated as bounded ASCII HTTP tokens before startup. Test configured and generated response-header size boundaries, including a maximal route table; run the same checks on Linux.
SEC-R08 P2 Plausible probe-amplification risk. Readiness can synchronously invoke a dependency probe; operational endpoint exposure/authentication needs a deployment-specific reproduction. Bound/cache dependency probes, protect or isolate operational endpoints, and test repeated probes during database degradation.
SEC-R09 P2 Host allowlist implemented; browser rebinding remains unverified. YAZA_ALLOWED_HOSTS accepts at most 32 exact host names, rejects wildcard/port entries, and compares case-insensitively while ignoring the request port. Loopback defaults to 127.0.0.1, localhost, and the configured loopback address; a non-loopback bind without a list is rejected before listening. The API HTTP smoke rejects wildcard configuration and unlisted hosts and accepts a configured mixed-case hostname. Add a browser-based DNS-rebinding regression where feasible; verify reverse-proxy deployment configuration and repeat the smoke on Linux. Host allowlisting is not authentication, CORS, or TLS.
SEC-R10 P2 Current limitation. Rate limiting is process-local and keyed by IPv4 peer; trusted-proxy and IPv6 identity policy are absent. Never trust forwarding headers by default. Add explicit proxy CIDRs, validated client identity, IPv6 behavior, and bounded eviction; document distributed quotas separately.
SEC-R11 P2 Potential stack-amplification issue. JSON nesting and fixed local key storage deserve measurement; the proposed stack estimate is not yet reproduced. Measure worst-case stack use at maximum depth and on small-stack workers; move bounded scratch storage to a request arena if needed.
SEC-R12 P1 Two-slot shared-token overlap rotation implemented locally; lifecycle and deployment gaps remain. Startup validates primary and optional secondary credentials independently at 32–1,024 Bearer-token bytes, rejects secondary-only and duplicate values, and never logs token contents. When both credentials are configured, every authenticated request compares both padded candidates without stopping after the first match. The route-auth smoke exercises both valid slots and invalid startup configurations normally and under ASan/UBSan; the full API HTTP CRUD smoke and private-.env loader smoke pass on macOS. Hosted/Linux evidence remains pending. yaza secret token emits 32 OS-CSPRNG bytes as 64 lowercase hex characters. A minimum length alone cannot establish entropy for manually chosen values, and this is not central revocation or per-user credential management. Document and exercise fleet rotation/revocation procedures; prevent example values from being used in non-loopback deployments; verify deployment secret handling and prevent token disclosure through shell history/process inspection; repeat security tests on supported targets.

4.2 Memory, secrets, environment, and child processes

ID Priority Latest assessment Required follow-up
SEC-M01 P3 Mitigated in the current native net_read path. Successful reads shrink the buffer to the received byte count, and EOF, timeout, cancellation, and other error paths free the temporary allocation. tests/net_transport.c verifies exact 4-byte retention after a short read, 64 repeated 1 MiB timeouts retaining under 16 KiB of arena memory, zero retained bytes on EOF, and cancellation cleanup. Normal, ASan/UBSan, and ThreadSanitizer runs pass on macOS. This is allocator accounting rather than an RSS soak, and Linux TLS-provider behavior remains unverified. Add a repeated large-read/timeout RSS soak on each supported platform and verify the same bounds through successful, EOF, and cancellation paths for every TLS provider.
SEC-M03 P1 Confirmed limitation. General arena reset/free does not wipe every secret copy; explicit secret zeroization only covers values and paths that call it. Add secret-owned storage/lifetime rules, prevent implicit conversion/copy where possible, wipe on scope exit/reset, and test copies, errors, cancellation, and logs.
SEC-M04 P2 Platform review required. The attachment's /dev/urandom claim must be checked against each current OS randomness path. Use the platform CSPRNG API, handle failure without leaking descriptors or silently weakening randomness, and test supported targets.
SEC-E01 P1 Implemented and smoke-tested on macOS arm64. .env opens with no-follow semantics, requires a regular file owned by the effective user with owner-only read/write permissions, rejects files above 1 MiB and embedded NUL bytes, and ignores loader, toolchain, sanitizer, interpreter-injection, and internal/test control keys. Shell values keep precedence. The focused smoke passes private-file loading and rejects permissive mode, symlink, binary input, and reserved keys. Repeat on each supported OS and add production-mode behavior and file-race review. .env remains optional trusted local configuration, not a secret manager.
SEC-E02 P1 Explicit-environment variants implemented and locally exercised. process_env, process_timeout_env, and process_capture_env pass exactly the supplied entries and reject LD_*, DYLD_*, GCONV_PATH, and GLIBC_TUNABLES; explicit PATH entries must be absolute and cannot contain empty, . or .. components. Argument and environment lists are separately bounded to 256 entries, 8 KiB per entry, and 128 KiB aggregate bytes. Tests confirm no ambient secret is added, reject loader/PATH injection and oversized argument lists, and cover explicit execution and timeout termination; diagnostic tests confirm explicitly listed internal metadata and sanitizer options still work. Native Clang builds receive only PATH and selected toolchain values. Legacy process, process_capture, and timeout variants still inherit the parent environment. Migrate remaining controlled tool invocations to explicit environments, decide and document the compatibility policy for inherited variants, add OS sandboxing for untrusted projects, and repeat tests on every supported OS.
SEC-E03 P2 Compiler environment narrowed; compatibility variants retain inheritance. Native Clang receives only the constructed build allowlist; explicit PATH entries are checked for absolute, traversal-free components, so unrelated ambient secrets and loader settings are not passed to that invocation. The local self-host bootstrap and diagnostics checks pass. Review all other child-process paths and compiler/test orchestration before closing; no executable command allowlist or child-process sandbox is provided.

4.3 Cryptography and authentication helpers

ID Priority Latest assessment Required follow-up
SEC-C01 P2 API-design gap. Argon2id salt is supplied by the caller; a repeated/fixed salt can weaken password-hash privacy. Supply a CSPRNG-generated salt by default, encode parameters/version in the stored hash, and retain an explicit low-level API only for expert use.
SEC-C02 P2 Unverified TLS edge case. IP-literal certificate identity checks differ by provider; no successful IP-SAN matrix is recorded. Test DNS SAN, IPv4 SAN, IPv6 SAN, wrong host, wrong CA, expiry, rotation, and downgrade on every provider/target.
SEC-C03 P2 Bounded but potentially expensive work. PBKDF2 permits a caller-selected work factor up to one million iterations. Provide a policy-level safe default and maximum; prevent untrusted request fields from selecting the work factor; move expensive hashing to a bounded compute pool.
SEC-C04 P1 Authentication lifecycle/design gap; no token-forgery exploit is established. JWT validation uses one configured HS256 secret and returns verified top-level string claims. sub and iat are optional; there is no jti revocation check, issuer integration, typed principal, role policy, key ID, overlapping JWT signing-key rotation, or per-user credential lifecycle. Any holder of the symmetric key can mint accepted tokens for the configured issuer/audience. Keep JWT behind explicit route policies; define typed principal and deny-by-default function/object/tenant/property authorization; use short-lived credentials and planned key rotation/revocation; test key compromise and issuer/audience separation before non-loopback production use.

4.4 Compiler, build, and supply chain

ID Priority Latest assessment Required follow-up
SEC-B01 P1 Source-observed build-path risk. Runtime/tool discovery and native compiler lookup depend on the project working directory and PATH in some paths. This is relevant when compiling untrusted projects, not proof of remote code execution. Resolve bundled runtime/tool paths from a trusted installation root; use explicit tool paths and a controlled environment; test with hostile same-named files and executables in the project directory.
SEC-B02 P2 Hardening is partial. Existing PIE/stack/fortify/format options are useful but not a complete, platform-specific policy. Compare release flags against current OpenSSF compiler-hardening guidance; add supported warnings, stack-clash/control-flow protections where applicable, and verify emitted binary properties per target.
SEC-B03 P2 Code-generation boundary needs adversarial tests. The compiler escapes quotes and backslashes in C string literals; this reduces risk, but does not prove every control character and metadata path safe. No generated-C exploit is reproduced. Fuzz literals, route metadata, identifiers, and diagnostics; compile generated output under strict warnings and sanitizers; add minimized regression cases for every failure.
SEC-B04 P1 Confirmed product gap for untrusted builds. Compiler/test execution has no OS sandbox or service-level CPU, memory, process, filesystem, and network confinement. For build services, isolate each job with an OS sandbox/container, no host secrets, read-only source, minimal writable output, network default-deny, resource limits, and disposable identity.
SEC-B05 P2 Installer/bootstrap integrity requires a reproducibility review. The update path needs authenticated inputs and atomic replacement; the attachment did not provide a reproduction. Pin the bootstrap source/revision, verify checksums/signatures or provenance, stage into a private directory, validate before install, and atomically replace with rollback.
SEC-B06 P2 Distribution identity is absent by design today. The local macOS package is unsigned/unnotarized and lacks a complete standard-library installation story. Provide checksums and verifiable build provenance at minimum; package the matching standard library. Document Gatekeeper prompts honestly. Artifact checksums do not establish publisher identity.
SEC-B07 P2 Confirmed process gap. Native dependency versions, advisory monitoring, and an SBOM/release policy are incomplete. Inventory and pin native dependencies; generate an SBOM for each release; monitor advisories; assign patch owners and deadlines.

4.5 PostgreSQL and data protection

ID Priority Latest assessment Required follow-up
SEC-P01 P2 Partial cancellation/timeout coverage. A bounded client deadline exists; server-side statement limits and cancellation are not consistently demonstrated for the pure-YAZA path. Apply statement/lock/idle-transaction limits on every connection; cancel server work where protocol state permits; test client cancellation and database recovery.
SEC-P02 P2 Bounded protocol, inefficient/limited read model. net_read caps one read at 1 MiB; repeated exact reads and response concatenation may consume excess memory/copying. Add bounded incremental frame reads and amortized builders; fuzz partial frames and test peak memory.
SEC-P03 P2 Policy consistency gap. std/pg and the legacy native/libpq path do not yet have one externally tested configuration contract. Make std/pg the intended canonical path after interoperability gates; retain any compatibility provider only behind the same TLS/timeout/conformance suite. Plaintext must be explicit and loopback-only.
SEC-P04 P2 Known SCRAM feature limits. The current implementation records ASCII-only credentials, no SASLprep, bounded iteration counts, and no channel binding; RFC vectors are present. Document the supported profile, add Unicode SASLprep or reject clearly, keep iteration bounds, protect password memory, and add channel binding only with reviewed interoperability tests.
SEC-P05 P1 Two client paths increase policy drift. Pure-YAZA PostgreSQL modules and a legacy native/libpq path coexist. Designate one default path, share conformance tests and error policy, and remove or isolate the legacy path when parity is proven.
SEC-P06 P2 Deployment control, not an observed code defect. Database applications can run with overprivileged credentials or unsafe search paths. Separate migration/DDL and application/DML roles, use least privilege, pin search_path, and add row-level controls only with explicit tenant tests.
SEC-D01 P2 Application consistency feature gap. CRUD locking does not provide an HTTP precondition or retry-safe idempotency contract. Add ETag/If-Match for concurrent updates and an idempotency-key design for business operations where retries could duplicate effects.
SEC-D02 P2 Privacy governance is incomplete. Heuristic log redaction is not a data classification or retention system. Define field classification, retention/deletion, backup encryption and restore testing; make logs avoid request bodies and credentials by construction.

4.6 Fuzzing, CI, scheduler, and templates

ID Priority Latest assessment Required follow-up
SEC-F01 P1 Fatal UBSan is implemented and locally verified; hosted Linux evidence is pending. Both libFuzzer and deterministic fallback compile with -fno-sanitize-recover=undefined. tests/fuzz-regression-pipeline.sh runs a signed-overflow probe and requires UBSan to terminate it; the regression pipeline passes locally. A 10,000-case macOS deterministic ASan/UBSan run replayed six seeds. Require a successful hosted Ubuntu run of the pinned workflow; retain corpus replay and crash artifacts; review and commit minimized regressions for every valid finding. The source-level gate is closed locally, not the hosted-CI/release gate.
SEC-F02 P2 Fuzz scope is narrow. HTTP/JSON parser fuzzing does not cover the full compiler, PostgreSQL frames/SCRAM, URL/filesystem, process, code-generation, or API generator boundaries. Add bounded fuzz targets by trust boundary and keep separate time budgets/corpora.
SEC-F03 P2 Differential coverage is missing or incomplete. SCRAM/RFC primitive vectors are recorded; HTTP parser differential testing is not. Differentially compare HTTP framing decisions with a maintained reference parser; retain RFC vectors and add regression seeds for disagreements.
SEC-F04 P1 Partly stale. A Linux Ubuntu CI workflow exists for C runtime sanitizers and parser fuzzing; full compiler, API, PostgreSQL, and release conformance is still not established on Linux. Add Linux end-to-end compiler and API jobs; require all supported architectures in release branch protection; keep unsupported targets explicitly unsupported.
SEC-S01 P2 Partly addressed. The internal scheduler has deterministic tests for task capacity, timers, wake, joins, cancellation, cleanup, and handle reuse. It is cooperative and single-worker; language-visible async and multi-worker race evidence are absent. Add property/state-machine tests and prove resource invariants before multi-worker execution; bound task CPU, memory, queue, and cancellation latency.
SEC-W01 P2 Template review remains a release gate. Security defaults vary with auth, TLS proxy, cookies, secrets, and container settings; the proposal's template-lint requirements are not fully present. Lint every generated template for embedded secrets, wildcard CORS, unsafe binds, root containers, missing CSRF/cookie flags when sessions exist, and documented proxy/TLS boundaries.

4.7 Current trend and future risk horizon (reviewed 2026-10-28)

The trend assessment combines YAZA's actual boundaries with current OWASP, CISA, and NIST guidance. “Future” rows are conditional projections, not current vulnerabilities. The OWASP Top 10 is risk-awareness guidance, and its data necessarily lags some newly emerging attack patterns.

Trend or horizon Relevance to YAZA Current assessment Proposal
Software supply-chain compromise and insecure defaults The compiler, native toolchain, future package registry, release artifacts, editor integrations, CI credentials, and template configuration form a long chain of trust. Current high-priority gap. Dependency inventory/advisory enforcement, lockfiles, SBOM, verifiable provenance, trusted publishing, and artifact verification are incomplete. Close SEC-B05–B07 before public package distribution. Pin CI actions/dependencies, isolate builds, produce and verify provenance/SBOM, and keep signing identities outside test jobs.
Memory corruption in native/compiler boundaries YAZA currently emits C and includes a handwritten C runtime. Generated programs and runtime operations therefore retain C memory-safety failure modes even where source-level YAZA APIs are typed. Current structural risk. Sanitizers and bounded APIs cover selected paths, but there is no full ownership/lifetime safety proof or complete compiler/runtime fuzzing. Treat generated C and runtime C as trusted computing base. Expand fuzzing and static analysis, define ownership/unsafe/FFI rules, and adopt memory-safe implementation components where feasible. Do not describe YAZA as memory-safe yet.
Agentic AI and autonomous tool execution YAZA source, editor tooling, build commands, CI, and project files may later be read or acted on by coding agents; an agent with shell, filesystem, package, or release credentials can turn prompt/data compromise into real host actions. Conditional future risk. No YAZA-hosted agent runtime or MCP server is present in this scope. If agents are used externally, the exposed developer workflow still matters today. Treat repository text and external instructions as untrusted data. Use least-privilege tool permissions, isolated disposable workspaces, no release secrets, explicit approvals for destructive/network actions, per-run identities, and auditable outputs. Add an agent-specific threat model before integrating an autonomous agent.
AI-assisted vulnerability discovery and exploit generation Faster automated code review may shorten the time from bug discovery to exploit attempts, including for C and generated-code boundaries. Emerging projection. This is an operational planning inference, not evidence that YAZA has been targeted. NIST has documented an AI-assisted discovery that led a candidate signature algorithm to be withdrawn; that candidate was not a finalized NIST standard. Maintain a rapid private intake and patch path, continuously fuzz trust boundaries, retain regression corpora, and verify AI-generated findings manually before assigning severity or publishing.
SSRF and network destination abuse std/url parses an ASCII subset but explicitly does not resolve DNS or authorize destinations; low-level TCP is available. A future HTTP client, webhook sender, package fetcher, or agent tool would inherit this gap. Future feature risk, with low-level network capability already available. No complete outbound HTTP client or general egress policy is recorded. Before adding fetch-like APIs, design DNS resolution and address re-checks, block loopback/private/link-local/metadata targets by default, pin or revalidate redirect destinations, cap size/time, and expose egress policy as a capability.
Long-lived cryptographic agility and post-quantum migration PostgreSQL TLS currently relies on platform providers and ordinary certificates. Long-lived stored data or future public-key signing could outlive today's algorithms and providers. Long-term planning risk, not a present cryptographic break. YAZA has no post-quantum protocol profile; HMAC-SHA-256 is not the public-key use case targeted by the initial migration work. Inventory algorithms and data-retention windows, keep protocol/provider choices replaceable, and adopt standardized post-quantum options only through maintained providers and interoperable protocols. Never implement a new primitive in YAZA source.
Concurrency, cancellation, and cross-request isolation The HTTP event loop is single-threaded and handlers/database operations are synchronous today. Completing async execution or multi-worker scheduling adds race, stale-context, cancellation-cleanup, and cross-tenant data risks. Future architecture risk with current availability impact. Synchronous slow work can block unrelated connections; multi-worker races are not a present runtime feature. Require request-context isolation, structured cancellation and cleanup, bounded worker queues, per-principal context propagation, race instrumentation, and state-machine tests before enabling parallel handler execution.
Plugin/editor and target capability expansion VS Code tooling exists; package/extension distribution and WASI/browser/mobile targets would add third-party code, host APIs, permissions, and signing/update boundaries. Current editor source; future distribution/target risk. Those targets are not verified release profiles. Use minimal extension permissions, publish verifiable signed artifacts, review update channels, and define explicit capability manifests and sandbox policies for each new target.

These risks should be re-ranked whenever YAZA adds a package manager, remote build service, outbound HTTP client, autonomous agent, extension distribution channel, multi-worker server, or new target. A trend report does not establish that a particular exploit exists in YAZA.

5. OWASP API Security Top 10 mapping

The API mapping is a separate reference from OWASP's general web application Top 10. The current general baseline is OWASP Top 10:2025 mapping; the API-specific baseline remains OWASP API Security Top 10:2023 mapping. The 2021 mapping is retained as a historical record. These categories are review prompts, not a claim of OWASP certification.

Category Current YAZA position Release requirement
API1 Broken Object Level Authorization No typed actor/ownership model is recorded. Negative cross-object and cross-tenant tests for every protected operation.
API2 Broken Authentication Shared Bearer tokens require at least 32 bytes and have a CSPRNG generator; HS256 JWT verification exists. Central revocation, JWT signing-key rotation, and user-token issuance remain absent; shared-token overlap rotation is implemented. Strong generated credentials, rotation, expiry, abuse limits, and tests for all invalid/expired cases.
API3 Broken Object Property Level Authorization Request schemas reject unknown fields, but per-role property access is absent. Define allowed read/write fields by principal and operation.
API4 Unrestricted Resource Consumption Several parser/body/connection limits exist; global CPU/RSS, work budgets, and uniform rate policies do not. Saturation, slow-client, expensive-handler, queue, and recovery tests.
API5 Broken Function Level Authorization Route policies include public/shared/JWT modes, not a full role/permission system. Deny-by-default policy tests for every route and method.
API6 Unrestricted Access to Sensitive Business Flows No generic abuse/idempotency policy is present. Application-defined limits and idempotency for sensitive flows.
API7 Server Side Request Forgery No complete outbound HTTP client exists; low-level network access is a capability. Resolve/recheck all addresses, block private/link-local/metadata destinations by policy, control redirects, and bound response size/time.
API8 Security Misconfiguration Some defaults are restrictive, but local tokenless mode, operational endpoints, proxy trust, and environment handling need deployment controls. Secure configuration validation, explicit trusted proxies/hosts, and template deployment tests.
API9 Improper Inventory Management OpenAPI generation helps enumerate declared routes. Versioned API inventory, operational endpoints, host inventory, and deprecation process.
API10 Unsafe Consumption of APIs PostgreSQL is the current external service; broader outbound clients are absent. Validate external responses, TLS identity, timeouts, size limits, and error redaction for every provider.

6. Security architecture requirements

These are proposed implementation requirements for the accepted YAZA RFC direction.

  1. Language and native boundary: Define checked arithmetic, bounds, nullability, initialization, ownership, lifetimes, destructors, unsafe, and FFI contracts before making memory-safety claims. Audit generated C and runtime C as part of the trusted computing base.
  2. Failure handling: Recover only typed, defined failures at request/task boundaries. A request panic must release request memory and leases and return a generic 500 while the server continues. Never continue after allocator corruption, a native signal, or unknown process state.
  3. HTTP and async execution: Keep all I/O and queues bounded. Finish the YAZA-owned async scheduler with cancellation, deadlines, fairness budgets, and a bounded blocking pool. Database, DNS, filesystem, and user handlers must not stall the event loop.
  4. Authentication and authorization: Keep public access explicit. Use principals and policy checks at function, object, tenant, and property levels. Shared secrets are bootstrap/service credentials, not an authorization model. Provide secure generation, overlap rotation, revocation, and audit-safe use.
  5. Transport security: The API runtime remains behind a verified TLS reverse proxy until inbound TLS is fully reviewed. Trust forwarding headers only from explicitly configured proxy peers. Remote database TLS must fail closed on invalid CA or hostname.
  6. Database safety: Bind every external value; raw SQL must be static trusted source. Use least-privileged application roles, separate migration roles, statement/lock/idle limits, bounded pools, and cancellation-safe transactions.
  7. Secret handling: Minimize secret copies and lifetime; never expose credentials in errors, logs, command lines, OpenAPI, Postman, or diagnostics. Do not invent cryptographic primitives. Use reviewed OS/provider implementations and test every platform.
  8. Filesystem and process capabilities: Treat source projects as executable programs. Keep path APIs rooted and no-follow. Child processes use explicit executable paths, bounded arguments/output/time, and allowlisted environments.
  9. Build isolation: Running untrusted source or tests requires a per-job OS sandbox. A temporary working directory alone is not a sandbox. Deny network and host secrets by default; mount only required inputs and outputs.
  10. Supply chain: Pin dependencies and CI actions, produce an SBOM and provenance for each release, verify artifact integrity, monitor advisories, and keep release credentials separate from build/test jobs.
  11. Observability and privacy: Emit bounded structured events with request IDs, not request bodies or tokens. Provide explicit classification/retention controls; log redaction is a secondary defense.
  12. Target-specific claims: A target is supported only after compiler, runtime, crypto/TLS, API, sandbox, and release evidence passes on that OS/architecture. Never inherit macOS results as Linux/mobile/WASM proof.

7. Secure deployment baseline

Until the runtime enforces these controls itself, deployment guidance and templates should require:

Area Baseline
Process identity Dedicated non-root user, no shell, no ambient capabilities.
Filesystem Read-only application image; only narrowly scoped writable directories; secrets are not baked into images or source.
OS isolation Seccomp/AppArmor/systemd hardening or an equivalent sandbox; set CPU, memory, process, and file-descriptor limits.
Network Bind the API privately behind a TLS-terminating proxy; keep PostgreSQL private; deny outbound network unless required.
Proxy Trust only named proxy addresses; cap body size and timeouts; set forwarding headers at the proxy, not from arbitrary clients.
Operations Restrict /metrics and readiness endpoints to the internal network or an explicit monitoring identity. Cache expensive dependency probes within a small bounded interval.
Database Separate migration and runtime roles; use verified TLS remotely; rotate credentials; encrypt and regularly restore-test backups.
Logging Never log authorization headers, database URLs, request bodies, or raw secret-bearing values; configure retention and access.
Updates Track YAZA and native dependency versions; apply security fixes through a verified artifact path.

8. Verification and release gates

Every result must be tied to a source revision, build toolchain, platform, and configuration.

Proposed assurance baselines: Use the stable OWASP ASVS 5.0.0 as a version-pinned checklist for the YAZA API release profile, targeting applicable Level 2 requirements and documenting every exclusion. This is a verification target, not an ASVS certification or a claim that the current API meets Level 2. Use NIST SSDF SP 800-218 v1.1 to organize secure development, build protection, verification, and vulnerability response. For build provenance, evaluate the SLSA v1.2 specification and select a build track/level only after the release pipeline emits and verifies the required attestations. These frameworks complement one another; none substitutes for source review, adversarial tests, platform-specific evidence, or incident readiness.

8.1 RCE and vulnerability-assurance objective

The engineering objective is to reduce the likelihood and impact of remote-code-execution and other vulnerabilities through independent controls at each trust boundary. It is not a promise that YAZA will pass every future security review or remain free of CVEs. A release may claim only the exact platform/profile for which current evidence exists.

Before making a production security claim, the release evidence must show all of the following for the claimed profile:

  1. Compiler boundary: adversarially test lexer/parser inputs, identifiers, route metadata, string literals, and generated C; use a safe C-literal encoder; compile generated output with warnings and sanitizers; and retain minimized regressions for every confirmed failure.
  2. Build and test boundary: never treat a temporary directory as isolation. Run untrusted builds/tests in an OS-enforced sandbox with no host secrets, default-deny network, read-only inputs, bounded writable output, and CPU, memory, process, and time limits. Until this exists, compiling or running untrusted YAZA projects is explicitly unsafe.
  3. Runtime/API boundary: require bounded parsing and queues, request deadlines, denial-by-default authentication/authorization tests, SQL parameter binding, verified TLS at the documented boundary, and saturation/recovery tests. One HTTP parser smoke or one sanitizer run is not sufficient.
  4. Native and dependency boundary: review C runtime and FFI as trusted computing base; run memory/undefined-behavior instrumentation and fuzzing; inventory native and source dependencies; monitor advisories; and produce a verifiable SBOM and build provenance for each release.
  5. Response boundary: maintain a private, monitored vulnerability-reporting route; assign triage ownership; reproduce and prioritize reports; issue fixes/advisories for confirmed vulnerabilities; and exercise credential and release-key incident playbooks.

An open P0 or P1 finding blocks the affected release profile unless the feature is disabled or an explicitly approved containment is documented. Passing these gates is evidence of due diligence for the tested revision and configuration; it is not proof that no unknown vulnerability exists. CVE assignment is handled only after a vulnerability is confirmed and follows the applicable CNA/advisory process.

Gate Minimum evidence
Compiler/native safety Release hardening review; warning-clean build where practical; Clang Static Analyzer or equivalent SAST on compiler/runtime and generated C; ASan and UBSan with fatal undefined behavior; regression tests for every sanitizer/fuzz finding. Add TSan/race instrumentation when multi-worker code exists. SAST is a proposed release gate, not a current YAZA capability.
Parser/code generation Seeded coverage-guided fuzzing for HTTP, JSON, lexer/parser, generated C literals/metadata, URL, filesystem, and database framing; differential HTTP tests; durable minimized corpus.
HTTP/API Framing and request-smuggling tests, slow clients, overload, panic/error recovery, shutdown, authentication and deny-by-default authorization matrices, response/log secret checks, and OpenAPI-driven negative API testing (for example, Schemathesis or OWASP ZAP).
Database Positive and negative TLS hostname/CA tests; SCRAM vectors; query parameter injection tests; deadline/cancellation; pool saturation; migration rollback and least-privilege tests.
RCE and command-execution boundary Adversarial tests for generated-C literals/metadata, tool and PATH substitution, shell argument handling, child-process environment, path escapes, and malicious project/test inputs. No untrusted project job may access host secrets or unrestricted host capabilities.
Build isolation Sandbox escape tests for filesystem, process, network, environment, CPU/memory, and timeout; no CI host secrets visible to the job. A private temporary directory alone does not pass this gate.
Supply chain Dependency inventory/advisory review, SBOM, pinned workflow actions, provenance, artifact checksum/signature verification, and independent reproducibility checks.
Platform Full native compiler/API smoke on macOS arm64 and Linux release architectures. Add Windows/mobile/WASM only when their complete target-specific gates exist.
Operations Tested vulnerability intake, patch/release/advisory workflow, credential rotation, backup restore, and incident exercise.
Independent review External compiler/runtime and cryptography review before 1.0 or other stable production claim; fix or explicitly mitigate all P0/P1 findings first.

The configured Linux runtime-security workflow currently covers C runtime sanitizers and narrow parser fuzzing. Both fuzz modes now fail on UBSan findings, and the regression pipeline tests that behavior; a local 10,000-case deterministic ASan/UBSan run passed. It is valuable but is not the full Linux compiler/API release gate. Hosted execution and branch protection must be verified before calling those gates enforced.

9. Vulnerability disclosure, CVEs, and incident response

9.1 Intake and coordinated disclosure

Before public distribution, establish a working private report channel: enable private vulnerability reporting for the public repository or publish a monitored security contact. A SECURITY.md file without an active contact or enabled private route is not sufficient. Assign a triage owner and backup, track private reports, preserve evidence, and avoid public issue filing before a fix is coordinated.

Proposed service targets, not yet commitments:

Severity Acknowledge Triage/reproduction plan Target mitigation
Critical / P0 Within 1 business day Within 2 business days Contain immediately; ship a fix or disable the affected feature as quickly as validation allows.
High / P1 Within 3 business days Within 5 business days Publish a fix or a tracked mitigation plan before the next production release.
Moderate / P2 Within 10 business days Within 15 business days Prioritize in the security backlog and communicate the intended release.

These targets must not be published as an operational promise until the owner, channel, and release process are staffed and exercised.

9.2 CVE and advisory handling

For a confirmed issue, identify affected versions and configurations, assign impact and severity, create a regression test, coordinate a fix and disclosure date, publish patched versions and upgrade guidance, and preserve a machine-readable advisory. Request a CVE ID through an eligible CNA or supported advisory platform when the issue meets that process. A CVE ID identifies a vulnerability; it does not mean YAZA has passed a security audit. Do not label an unverified source-review candidate as a CVE.

9.3 Incident playbooks

  • API/database credential exposure: revoke or rotate, inspect access logs without disclosing the secret, identify affected records, notify the application owner, and deploy the replacement through a secret manager.
  • Release key or CI compromise: disable publishing, revoke affected credentials, identify artifacts by provenance/SBOM, replace them, and publish an advisory.
  • Dependency compromise: locate affected releases from the SBOM, pin/upgrade, rebuild in a clean environment, and publish affected version ranges.
  • Compiler/runtime vulnerability: reproduce on a supported target, create a minimized regression, assess generated native programs and downstream applications, patch/backport, and coordinate disclosure.
  • Data incident: contain access, preserve evidence, assess retention/backups, and follow the application owner's legal notification obligations.

9.4 Privacy

YAZA should provide mechanisms for application owners to classify fields, minimize collection, redact logs by construction, set retention/deletion policies, and protect backups. The application owner remains responsible for applicable privacy law and user notices; this proposal is not legal advice.

10. Implementation order

The product priority remains API first. Security work should proceed alongside API delivery and act as gates on claims and releases.

Phase Work Exit evidence
0 — Immediate API/runtime hardening Verify SEC-R01 on Linux; complete SEC-R12 credential lifecycle beyond the implemented minimum, generator, and shared-token overlap; verify the fatal-UBSan fuzz gate on hosted Ubuntu; review child-process environment and .env; classify request-reachable fatal failures; bound operational probes and accept overload. Linux API smoke and idle-CPU evidence; short-token rejection and CSPRNG-generator smokes; two-slot shared-token rotation smoke and central-revocation design; successful hosted sanitizer/fuzz job; environment inheritance tests; explicit request failure behavior.
1 — API security completion Add typed principal/object/tenant authorization; align PostgreSQL providers and TLS policy; complete query cancellation/timeouts; add trusted-proxy policy, concurrency/idempotency semantics, and template security lint. Negative authorization matrix; live TLS positive/negative tests; cancellation/overload tests; proxy trust tests; safe generated template audit.
2 — Language/runtime trust boundary Implement the accepted core type, ownership/unsafe, error, async, and standard-library rules; audit generated C; add sandboxed execution for untrusted builds/tests. Language conformance, memory/race instrumentation, sandbox escape/resource tests, and independent review.
3 — Supply chain and release Pin and inventory dependencies; SBOM, provenance, artifact verification, trusted publishing, vulnerability policy, and credential rotation. Verifiable release from source to artifact; active private reporting and exercised incident workflow.
4 — New targets and ecosystem Add Linux full support first; then treat WASM/edge/mobile/Windows as separate threat models and capability reviews. Per-target compiler, runtime, crypto, API, isolation, and release evidence before each target is called supported.

These defaults resolve the open questions in the additions without claiming implementation:

  • Use the YAZA-owned structured scheduler and a bounded blocking pool; retain synchronous APIs only as explicitly blocking operations.
  • Treat request-level typed failures as recoverable; fail the process for corruption or unknown native faults.
  • Make pure-YAZA std/pg the intended PostgreSQL path after TLS and live-server conformance; keep any compatibility client behind the same tests until it can be removed.
  • Keep API bind loopback by default. Require a strong generated credential and explicit route policy for non-loopback exposure; use a verified TLS proxy until inbound TLS is release-ready.
  • Do not trust forwarded client-IP/host headers without explicit proxy/host allowlists.
  • Keep the macOS package unsigned if that remains the distribution choice, but provide checksum and provenance; never describe those as Apple publisher signing or notarization.
  • Do not run untrusted compiler/test input without OS-level isolation.

11. Release claim criteria

Before a YAZA profile is described as production-ready or secure for sensitive data:

  1. The exact profile, OS/architecture, compiler/runtime version, and deployment boundary are named.
  2. No open P0/P1 issue affects that profile without a documented, approved containment measure.
  3. Compiler/runtime memory and unsafe boundaries have an implementation contract and independent review; sanitizer/fuzz results are current.
  4. API authentication and object/tenant authorization tests pass; TLS, database cancellation, and resource-exhaustion tests pass on the claimed target.
  5. Untrusted builds/tests run in a verified OS sandbox.
  6. Dependencies, SBOM, provenance, and release artifacts are reviewable and verifiable.
  7. A private vulnerability channel and incident response process are active.
  8. Limitations and residual risks are published. No claim says “zero CVEs,” “unhackable,” or “guaranteed secure.”

12. References

Repository evidence

External references