KKraul · docs
← Kraul home

Security and privacy considerations

This is a design checklist for future engine implementation. It is not a claim that a complete security review has been performed.

1. Treat image inputs as untrusted

Files may be malformed, unexpectedly large or crafted to stress decoders. Validate declared and decoded dimensions, enforce size and pixel-count limits, handle decode failures and avoid unbounded allocations.

Do not trust filename extensions or user-supplied MIME types as the only validation step.

2. Resource exhaustion

Image memory usage can be much larger than the compressed file size. Apply limits before decoding where possible, account for width × height × channel count, and release temporary buffers after both success and failure.

If concurrency is supported, define a limit and test how queued jobs behave under load.

3. Browser boundaries

If the engine runs in a browser, document which APIs it requires and whether it makes network requests. Avoid dynamic execution of user-controlled strings. Treat remote URLs and cross-origin behavior explicitly rather than silently fetching arbitrary resources.

If workers or object URLs are used, define lifecycle and cleanup rules.

4. Privacy by design

State clearly whether input images stay on the device or are sent to a remote service. Never claim local-only processing unless the implementation and network behavior prove it. Avoid logging image contents or personal metadata. Define whether EXIF or other embedded metadata is preserved, removed or normalized.

5. Dependency and supply-chain hygiene

When dependencies are introduced, pin and review versions; record license and purpose; update lockfiles consistently; scan for known vulnerabilities where suitable; and avoid loading executable assets from mutable third-party URLs in production without a reason.

If the engine remains dependency-free, verify that claim against the actual package and build output.

6. Error disclosure

Expose safe, actionable messages to end users. Keep technical details in controlled diagnostics and redact secrets, local paths and private payloads.

7. Security acceptance checklist

Every checkbox must be supported by evidence before it is marked complete.