6.2.0
API v6.2.0 — Security release: abusive inputs are bounded on every version, /cron dates fixed in some timezones.
- This is a security release: the issues found by an audit of the whole API are fixed, endpoint by endpoint. No endpoint is added or removed. A legitimate request gets exactly the same response as before; only abusive inputs are now refused, with the usual
400error, or bounded. Two changes are visible: /cron onv5andv6, whose dates were wrong in some timezones (missing or repeated dates east of UTC, and a schedule at local midnight skipped right after a daylight-saving change) and are now correct, and /chat, which now keeps only the last200messages of a room. - Exceptionally,
v4andv5receive these fixes too, although they are otherwise frozen: the same limits and refusals apply to every version that has the endpoint, andv6followsv5. Each item below says which versions it concerns, and the page of each endpoint gives the exact limits and error messages.
- /captcha (
v4,v5andv6): thetextparameter is capped at32characters. Onv5andv6, the signed token of a challenge can no longer be forged or exchanged for a token of another kind: a /pow token no longer verifies as a captcha token, nor the reverse. A token is burnt after5wrong answers and then answersused. POST /captcha also accepts an optionalminLength: a right answer to a captcha generated shorter than that is refused with the reasonweak. WithoutminLength, nothing changes. - /barcode (
v4,v5andv6): thedataof the variable-length formats,code128andcode39, is capped at128characters (Data cannot exceed 128 characters). The fixed-length formatsean13,ean8andupcaare not concerned. - /regex (
v4,v5andv6): the evaluation of a pattern is interrupted after25ms and answers400withPattern took too long to evaluate, so a catastrophic pattern can no longer block the server. Apatternortextkey repeated in the query is refused like a missing one. A pattern that finishes in time returns the same matches as before. - /cron: on
v5andv6, dates were missing or repeated in timezones east of UTC, and a schedule at local midnight could be skipped right after a daylight-saving change; the results are now correct.v4keeps its previous results. On all three versions, a cron expression that can never match, such as0 0 31 2 *, ends at once with an empty list instead of running until its limit, and a search is bounded in time (250ms onv5andv6,1s onv4): the dates found until then are returned. - /chat and /tic-tac-toe (
v4,v5andv6): their inputs are bounded, a username to100characters (1000for thefetchaction of/chat, which is keyed by the reader's IP address), a message to1000and a session, game or private chat identifier to256(Message cannot exceed 1000 characters). Names such as__proto__orconstructorare now ordinary values./chatkeeps the last200messages of the public room and of each private chat, allows at most1000private chats at a time (Too many active private chats), and replaces a clienttimestampthat cannot be stored as sent, an object or a text over128characters, with the server date. - /qrcode (the
iconparameter) and /hyperplanning (v4,v5andv6) fetch remote files through a guarded fetch: internal addresses are refused after name resolution and on every redirect, and redirects are capped at10. A calendar stops at1MB and5000events, an icon at2MB and16megapixels (Icon must be under 16 megapixels). Deprecated - POST /asymmetric (
v5andv6): RSA key pairs are now generated off the main thread, two at a time, so a large key no longer freezes the server for the other requests. The response is the same.
- The rate limiter counts against the instance-wide limit only the requests it admits, so a client being refused can no longer use up the budget of the others. An IPv6 client is counted by its
/64block, an IPv4-mapped IPv6 address by its IPv4 form, and each/48network is capped at four times the hourly quota of one client (Too many requests from your network.,429). A forwarded address that is not an IP address counts as the connecting peer. - The security headers are now sent first, so every response carries them, and request bodies, still capped at
10kB, are parsed after the rate limiter, so malformed bodies are counted too. - When
TRUSTED_PROXIESis unset, the server keeps assuming exactly one reverse proxy and now logs a warning at startup. That default is right behind a single proxy such as nginx or Caddy; exposed directly, callers can forge theX-Forwarded-Forheader and pick their own address, and behind several hops every caller is counted as the nearest proxy. The README explains when to set the variable.
- New
asymmetricAsyncexport, available from@moxon/api,@moxon/api/v5and@moxon/api/v6: it takes the same arguments and returns the same result asasymmetric, as a promise, and generates RSA key pairs on the thread pool, at most two at a time.POST /asymmetricuses it. - The experimental Manifest export is not touched by this release: it still lists only
hash, and describing the other endpoints as contracts is planned for a later release. Experimental - Dependencies are updated:
body-parsergoes to2.4.0, with theqs(6.16.1) andiconv-lite(0.7.3) it uses. These versions are pinned in the repository'spackage-lock.json: they protect clones and deployments done withnpm ci.
- The page of each endpoint touched by the release states its new limits: the parameters, the exact error messages and a note on what is bounded. POST /captcha documents its new
minLengthparameter. Exceptionally, the pages ofv4andv5are updated too, for these limits and refusals only. - The Authentication page explains how requests are counted, per
/64block and per/48network for IPv6, and the list of429errors of the home includesToo many requests from your network.. - The Instance page lists
TRUSTED_PROXIESandGLOBAL_LIMITamong the settings of an instance you run, with a warning on matching the proxy chain.
Last updated on November 14, 2026