skeld Get started

Security

What skeld leaves open, and what you can do.

Every limit the maintainers know of and accepted, with what it means for your service and what you can do about it. Gaps that are not yet closed are listed separately.

The network and the connection
5
Requests and responses
14
The typed client
2
Logging
7
Sign-in, sessions and tokens
10
The store behind sign-in
6
The database
12
The API document
3
Startup, shutdown and the process
4
How skeld is built and released
2
Switches that remove a protection
9
Not yet done
8
The network and the connection5 entries
The limit What it means for you What you can do
Connections are capped in total, at 10,000, and not per client. No route has a rate limit until you add one. One client can hold every connection, or call a route as fast as it likes. Limit per address at your proxy. Add limitRoutes from @skeld/data or the limits in @skeld/auth to the routes that need them.
A request that Node's HTTP parser rejects gets Node's own answer: a malformed request, a head over 16,384 bytes, headers that take longer than 60 s. It has no request id and leaves no record in skeld's log. Count these at the proxy in front.
A client whose upload is refused may not receive the 413. When many refused uploads are open at once, during shutdown, or when the transport fails, the client sees a closed connection instead. Treat a connection closed during an upload as a possible refusal.
A request sent on the same connection behind an upload that proves too large while it streams can still run its handler, and gets no response. This needs an asynchronous onRequest hook on the refused route. A handler can run for a request whose client never hears back. Make handlers safe to run without their answer arriving, as a dropped connection already requires.
A proxy you list in trustProxy is believed. The client address in records and limiters is whatever that proxy says. List only proxies you run, and have them replace the forwarding header.
Requests and responses14 entries
The limit What it means for you What you can do
The default cross-site check passes a POST, PUT, PATCH or DELETE that carries neither Origin nor Sec-Fetch-Site, because clients that are not browsers send neither. The check rests on browsers sending those headers. It is not authentication: a caller that is not a browser can send any header it likes. Use strict mode on routes a browser reaches with a cookie. @skeld/auth refuses to start a session route without it.
A sibling subdomain can set a second cookie with your cookie's name. Your declared cookie then fails validation for that visitor. Access is denied; the session is not taken over. Give cookies a __Host- name.
One unbounded or open part in a body schema removes the schema-derived size cap for that route, leaving the 1 MiB body limit. A hostile 1 MiB body of about 96,000 keys took 65 to 82 ms to refuse in the maintainers' measurement, and that time blocks other requests. Keep bounds on body schemas, lower bodyLimit for the route, and put a rate limit on it.
A body sent to a route that declares none is read by Node and thrown away. It costs bandwidth, and nothing else, until the request timeout. Limit request sizes at the proxy if this matters.
Invalid UTF-8 bytes in a body are replaced with the Unicode replacement character before validation. The handler can see a value that differs from the bytes sent. The value still has to pass the schema. Nothing in most services: the party affected is the sender of the bad bytes.
The request validator is code generated by skeld and has little production history. It is compared with a second implementation of the same rules on 48,000 generated cases, which covers the shapes that generator produces. A defect in it would accept or refuse a shape wrongly. Report any request that passes or fails against its declaration.
If other code in the process adds an enumerable property to JavaScript's Object.prototype, every closed object fails validation. Requests are refused. Nothing extra is accepted. Do not load code that changes built-in prototypes.
The handler deadline starts at the request's first wait. Synchronous code is not interrupted, and work already started is not undone when the 503 is sent. A handler that computes for a long time without waiting is not stopped, and a handler that ignores its abort signal keeps working after the client was answered. Pass the request's signal to what you call, bound your own calls, and keep long computation out of handlers.
A hook's send writes its payload as given. No response schema filters it. A hook that answers early can send a field it should not. Review hooks that call send. For an error, throw HttpError, which goes through the error serializer.
When a response is declared as a union and the returned value has an undeclared field, the value matches no member. The request ends as the fixed 500. For a plain object response, the extra field is left out. Return exactly a declared member. The failure shows at the first request in development.
A schema made with t.omit passes on any field added to its base later, a personal one included. A new field can reach a response nobody reviewed. A new secret field is still caught at startup. Build response schemas with t.pick, which lists what is sent.
Only the Location of a 3xx response is checked. A Location on a 201 is not, and an origin you allowed can itself redirect onward. A redirect policy is not a guarantee about where a browser ends up. Do not put secrets in URLs, and list only origins you control.
A response skeld writes before a route is matched, such as a 404 or a 400 for a malformed request, carries no cross-origin headers. A browser application on another origin cannot read those errors. Handle a failed request without a readable body in the browser code.
With securityHeaders: false, a 404 or 414 carries no cache directive. A shared cache in front may store it and serve it after the route exists. Leave the default headers on, or set a cache policy at the proxy.
The typed client2 entries
The limit What it means for you What you can do
A response whose status the contract does not declare, or declares with no body schema, is handed to the caller unvalidated. Typed code does not make an unexpected answer safe. Check the status before you use the body.
timeoutMs: false, or a custom fetch that ignores the abort signal it is given, leaves a call with no time limit. A peer that never answers holds the call for as long as the transport does. Keep the default of 30 s, or raise it to a number. A custom fetch must honour signal.
Logging7 entries
The limit What it means for you What you can do
Masking needs the schema. A plain string, text built into a message, a copy of a request part such as { ...request.body }, a piece nested inside a part, and a part whose route declares no schema are all written as given. An email address logged as a bare string appears in full. Pass the validated part itself to the log call, or use request.classified. Never build a message from request values.
A field declared with no class, or as public, is written in full. So are a record's keys, unless the key schema is personal. requireSensitivity is off by default, checks text fields only, and cannot tell a wrong public from a right one. The declaration is the only source of a field's class. skeld cannot infer it. Turn requireSensitivity on, and review each public.
Three log options admit text that nothing classifies: errorText writes an error's message, which can quote data; errorIdentifiers writes class names and codes; errorFrames writes stack frames with file paths, and runs the process's own stack formatter inside the log call. All three are off by default. With them on, the log can hold request data and internals. Leave them off in production, or restrict who reads that log.
Records still queued when the process ends without close() are lost and not counted. If the reader of stdout dies, up to 65,536 bytes are lost the same way. The log is not a guaranteed record. Delivery ends where your collector begins. Call close() on shutdown. Keep anything you must be able to prove in your own audit store.
A log sink runs in your process. One that blocks synchronously blocks every request; one that never settles stops delivery for its server; a stalled destination can delay the process's exit. A broken sink cannot report its own failure. Write sinks that are asynchronous and always settle. Watch logStats() from somewhere other than the log.
skeld coordinates only its own writes to stdout. console.log or a child process writing to the same pipe can split a record. Reserve stdout for the structured log and send other output to stderr.
Log writes and password hashing share Node's four worker threads. The helpers use at most two. The effect of heavy hashing on log latency has not been measured. Under a burst of sign-ins, log delivery may lag. Measure it under your own load if both matter to you.
Sign-in, sessions and tokens10 entries
The limit What it means for you What you can do
@skeld/auth has no accounts. Sign-up, the sign-in form, password change, reset, recovery, second factors and lockout are your application's. The password helpers do not make every failure take the same time, so a careless sign-in can reveal which accounts exist. Answer every failure the same way, verify an unknown user against a dummy hash, and charge a limit before verifying. The guide shows each step.
A JWT stays valid until it expires. Auth issues none and cannot revoke one. A stolen token works for its whole lifetime. Use short lifetimes at your issuer, or refuse a subject in map, which runs on every request.
Unless you set jwt.tokenTypes, any JWT the same issuer signed for the same audience is accepted, an ID Token or a logout token included. It is off by default because many issuers state no type. A token made for one purpose can be presented for another. Set tokenTypes: ['at+jwt'] if your issuer sends that type, or refuse other kinds by their claims in map.
Access is decided when a request is admitted. A permission removed while the request runs still applies to it, and a request already admitted completes after its session is revoked. Revocation takes effect at the next request, not in the middle of one. Keep requests short. Check again inside your own transaction where a late change must not go through.
A policy is enforced where its operation is called. Code that writes to the database directly is not checked, and a grant stored where another request can reach it can be used by that request while it is live. Auth cannot stop your own code from going around it. Do every protected write through its operation, and never keep a grant beyond its request.
If a second actor re-enables a user while that user's credential change is between its two steps, a sign-in on the old credential can succeed. The session it opens outlives the change. Run credential changes and any re-enabling of the same user one at a time.
A flood of well-formed but unknown session cookies or API keys costs one store read each. A JWT under a known key id costs one signature check. No limit can run before a credential has been read. Limit per address at the proxy.
An identity provider's discovery document can name any https host as its token or key endpoint, and auth will call it and send the client secret. A provider is trusted with where your service connects. Configure only providers you trust, and restrict outbound traffic where you can.
Only a generic OpenID Connect profile is tested. No named provider is claimed. A provider that departs from the profile may fail. Test sign-in against your provider before you depend on it.
A store you write yourself carries none of these guarantees unless it behaves as the shipped ones do. Auth cannot detect a store that breaks the rules. Run the conformance kit published with the package.
The store behind sign-in6 entries
The limit What it means for you What you can do
Rows in auth's store are not signed. Whoever can write that database can insert a session, re-enable a user or widen an API key's scopes. An existing SQLite file is used with whatever permissions it has. The database role and the file are part of your trust boundary. Give auth's store its own database role or file, and keep write access to it narrow.
A reader of the store, or of a backup, learns some things. An OpenID Connect attempt's nonce and PKCE verifier are stored as text for up to 600 s. The SHA-256 of an IPv4 address or of a short limit key can be reversed by trying every value. Tokens and keys are stored only as digests and are not exposed this way. Addresses are. Protect backups and read access as you would the live database.
A failover to a standby that had not received a commit, or a read from a replica, can lose or delay a revocation. A commit whose answer never arrived is reported as unknown. Every lifetime is measured on the database's clock. A revoked session can work once more after a failover. A clock set back lengthens every session by that much. Run auth on one primary with synchronous replication if a failover must not lose a revocation. Keep the database host's clock disciplined.
No table has a row limit, and expired rows are removed at no more than 1,000 a second per instance. The record that fences a user id is never removed. A flood can grow the tables faster than cleanup shrinks them. A user id stays in the store after you delete the user. Watch the size of the tables. Note the retained id if you have a duty to delete.
On SQLite, every commit runs on the main thread, and Node's node:sqlite is still a release candidate in Node 26. A long transaction of your own on the same file makes auth answer "unavailable". SQLite suits one instance and light load. Use PostgreSQL for more than one instance or for heavier load. Keep waits out of SQLite write transactions.
Auth's PostgreSQL store is tested on PostgreSQL 19. A pg pool waits without limit for a connection by default. Another server version is not covered by the tests. A pool that hangs while connecting makes every store call fail until it settles. Test on the version you run. Set connectionTimeoutMillis to 5,000 or less.
The database12 entries
The limit What it means for you What you can do
Two calls take SQL as a string: script(text) on a reserved connection, and query(text) through toPgPool. A request value joined into that string is SQL injection. Use the sql tag for anything that carries a value. Keep script for migrations.
insecure: 'plaintext' connects with no TLS: no encryption and no proof of who the server is. It exists for local development. Nothing stops a service shipping with it. Search your configuration for it before you deploy. skeld writes a data.insecure record at startup when it is set.
When the server's certificate is signed with RSA-PSS or Ed25519, channel binding cannot be built, and sign-in uses plain SCRAM under verified TLS. The certificate and host name are still verified. The extra tie between the sign-in and that TLS session is absent. Set channel_binding=require to refuse such a server.
Behaviour behind a connection pooler such as PgBouncer, and against managed PostgreSQL services, is not demonstrated. On a server or pooler that speaks only protocol 3.0, the key that authorises a cancel is 4 bytes and can be guessed. A pooler may refuse or change what skeld sends. A guessed key lets someone who can reach the database cancel a statement. Test behind your pooler first. Keep the database off networks that untrusted parties can reach.
The PostgreSQL client is skeld's own code and no driver is used. Protocol defects are skeld's to find. On any message that breaks the protocol, the connection is closed and nothing is resynchronised. Report a hang or a wrong result.
A cancel is not guaranteed to arrive. A cancelled statement outside a transaction may already have taken effect, and each abort costs one reconnect. An aborted request does not prove that its write did not happen. Put writes that must be all-or-nothing in a transaction.
Session state you set on a pooled connection, such as a role or a search_path, reaches the next request that gets that connection. One request's setting can change what another's query means. Use SET LOCAL inside a transaction, or a reserved connection, which is closed when released.
The PostgreSQL server's own log can hold statement text and parameter values. skeld's masking ends at the process boundary. Set the server's logging options with that in mind.
A SQLite statement runs on the main thread and cannot be interrupted. A slow statement stops every request until it ends. Keep SQLite statements short, or use PostgreSQL.
The limit on a result's size is an estimate, and it applies to one result at a time. In the maintainers' measurements the counted size was between 0.66 and 1.27 times the memory used. Memory in use follows how many results are alive at once, which the limit does not bound. Lower maxResultBytes for large rows, and page large reads.
Inside a transaction that has used a savepoint, rollback and chain sent as query text is not detected. Work before it is discarded, what follows is committed, and the transaction reports success. Do not send transaction control as query text. Use the transaction callback.
The rate limiter's counters are not durable. On PostgreSQL they are lost in a crash or failover; on SQLite they are kept per process. A flood of distinct addresses costs one statement each on the pool your queries share. Its 429 is written directly and no error handler or onError hook sees it. Limits restart with the database or the process. Under a flood the limiter competes with your own queries. Give the limiter a database handle of its own. Read the data.limit.refused record for refusals.
The API document3 entries
The limit What it means for you What you can do
The document describes the contract. It does not describe the running service. Tools may ignore the extensions that carry skeld's stricter rules, and the security section states what you wrote, not what is installed. A reader can assume more, or less, than the service enforces. Generate the document from the same contract you serve, and state the security section to match your auth configuration.
The document publishes each field's data class and each route's name. Anything you write in a description is published too. A reader learns which fields you treat as secret or personal. Keep secrets out of descriptions. Leave the document unpublished if the classes are sensitive in themselves.
Generating a document is synchronous work. A route that generates one per request can be made to occupy the service. Generate once, at build time or at startup.
Startup, shutdown and the process4 entries
The limit What it means for you What you can do
Shutdown has no single time limit. Each close callback has its own, 10 s by default, and they add up. An orchestrator's kill can cut the later callbacks. Keep close callbacks few and fast, and set the grace period to cover them.
skeld installs no signal handler and no handler for errors outside a request. A service that wires no signal to close() skips every cleanup on SIGTERM. Call close() from your signal handler. The guide shows the pattern.
skeld controls only the port it opens. A plugin can listen on another, and Node opens its inspector on 127.0.0.1:9229 when it receives SIGUSR1. A process described as having no listener may have one. Start Node with --disable-sigusr1, and enforce the rule for the whole process at your platform.
Your code, plugins, sinks and dependencies run with the process's full privileges. Code that loads before @skeld/auth can replace the certificate check auth relies on. skeld's controls are not a sandbox against code you chose to run. Review and pin what you load, and run the process with the least privilege it needs.
How skeld is built and released2 entries
The limit What it means for you What you can do
The compiler, the package manager and the build actions are pinned and trusted as pinned. There is no second, independent build to compare with. A tool that was already malicious when it was pinned would not be noticed by the build. Pin exact versions, check a package's npm provenance, and read the changes before you upgrade.
This assessment is the maintainers' own, and thirteen of the 242 controls have no recorded demonstration yet. Nobody outside the project has checked these claims. Test what matters to you, and report what you find.
Switches that remove a protection9 entries

Each of these is an option you write by name. Writing one is a decision worth a second reader.

Switch What it removes
unbounded on a field The size bound on that field, and with it the schema-derived body cap of its route.
open on an object The refusal of undeclared fields. They are accepted and dropped.
t.exposed on a field The refusal to send a secret field in a response.
A hook's send The response schema, for that reply.
securityHeaders: false The four default response headers.
csrfExempt The cross-site check, for the routes it names.
insecure: 'plaintext' TLS to the database.
timeoutMs: false The typed client's time limit.
errorText, errorIdentifiers, errorFrames The log's refusal to write unclassified error text.
Not yet done8 entries

These are gaps, not decisions. Each is an open item in the project.

What is missing What it means for you What you can do
skeld has no HTTPS listener, and whether it should have one is not decided. Traffic to the service is plain HTTP unless something in front encrypts it. Terminate TLS at a proxy and keep the hop to skeld on a protected network.
The typed client accepts an http: base URL and sends its bearer token over it. A token sent that way can be read on the network, and the client cannot tell who answered. Use https: base URLs outside local development.
With the default log settings a served request leaves no record, and no record names the caller. You cannot show from the log alone that a request was made, or by whom. Turn on log: { access: true }, and log the user where your handler knows it.
Strict-Transport-Security, a cross-origin resource policy and a Content Security Policy beyond frame-ancestors 'none' are not sent, and no option sends them. A browser application gets less protection from response headers than it could. Add the headers at your TLS terminator, or set them yourself on responses.
An issuer's RSA key is accepted from 2,048 bits for JWT and ID Token signatures. ASVS 5.0.0 asks for at least 128 bits of security and says RSA needs a 3,072-bit key to reach it. Use an issuer that signs with ES256 if you need a higher floor.
A JSON body that repeats a key is accepted, and the last value is used. A component in front that reads the first value would judge a different request from the one skeld serves. If a proxy or firewall inspects bodies, confirm how it treats repeated keys, or have it refuse them.
hashPassword accepts a one-character password, and the guide does not yet say that password rules are yours. Nothing in @skeld/auth stops a weak password. Enforce a minimum length and screen passwords before you call it.
@skeld/auth cannot list a user's sessions or end one of them. revokeSessions ends them all. You cannot offer "sign out that device". End all of a user's sessions when one may be stolen.

One more open item is not described here. Describing it before it is fixed would help someone misuse it.