More from Chirai · Chapter 23

Chiru

Chiru is the gate before every publish. It attacks your site's preview the way a real attacker would, with 32 checks, and only a break-in it can prove holds the publish. If Chiru can't get in, your site goes live as usual.

Note: while Chiru is new it reports what it finds and does not hold a publish yet. Holding is switched on once its reports have been checked on real sites.

Why we do this

A new site on the public internet is probed by automated attackers within hours. They don't care how small the business is: they try the same list of tricks on every address they find. Chiru tries that list first, on your preview, before anyone else can try it on your live site.

What happens when you press Publish

  1. Chirai checks your plan, as before.
  2. The first time you publish a site, a notice explains Chiru. Press Run Chiru and publish.
  3. Chiru attacks the preview. This takes a few minutes.
  4. If Chiru didn't get in, the site is published.
  5. If Chiru got in, publishing is on hold. You see what it did, the proof and the fix.

After the first publish there is no notice. Chiru runs again whenever the site's code has changed, including when Chirai publishes your changes by itself.

Proof or nothing

Chiru never holds a publish on a suspicion. Every finding comes with the exact request it sent and the answer that shows the way in, and it is sent a second time before it counts. A finding that doesn't repeat is dropped.

The 32 checks

GroupWhat Chiru tries
DoorsA stranger reading private rows. One customer reading, changing or deleting another's records, or saving rows in their name. Visitors and customers adding to tables only the owner should fill. Members' and admin pages opened signed out. A customer making themself an admin, or changing the price on their own order.
SecretsLive payment or cloud keys in the JavaScript every visitor is sent. The database's master key anywhere a browser can see it. Settings files (.env), code history (.git) and backups in the public folder. Keys written into the code. Test and debug addresses left on.
InjectionContent a customer saves (a review, a comment, a profile) that the page shows as HTML, so a saved script would run for the next visitor. Script carried in a link. A database filter changed to ask for everything. A link that sends your visitors on to another site. Uploading a web page or any file type to your storage.
MoneyA price or total sent by the buyer. Negative quantities and parts of an item. Someone else's order read or changed. A made-up "payment succeeded" message. A paid plan switched on without paying.
AbuseFlooding a form. Guessing passwords. A password-reset link used a second time. A form used to send one stranger email after email. Oversized requests.
HuntWhat only your site has: its own API addresses. Chiru plants a test customer's records, then asks each of your site's addresses for them as a visitor and as a second signed-in customer, and tries to change, cancel and delete them. A record that comes back, or is changed or gone afterwards, is the proof.
SetupMissing security headers. Sign-in cookies a script can read, and plain http:// calls. Other websites allowed to call your site's API as the signed-in visitor. Packages with known serious holes. Storage that lists or exposes files.

What holds a publish

  • Held: a proven critical or high finding in your site: its pages, its code, or its own database rules.
  • Shown, not held: medium and low findings. You decide.
  • Closed on the spot: many database rule problems. Chiru fixes the rule, runs the same attack again, and only reports it as closed when the attack no longer works. If a customer could make themself an admin, that one column is closed to customers; the rest of their row stays theirs to edit.
  • Chirai's own services: checkout, payments, sign-in and forms are shared by every Chirai site. If Chiru finds a problem there, it goes to Chirai to fix for everyone. It never holds your publish.

When Chiru gets in

Each finding comes with its proof and a fix. On Chiru's report page press Fix with IILA and attack again: IILA repairs the files Chiru named, your site is published again, and that publish runs the same attack again. The page then lists each earlier finding as "no longer works" or "still works", so the attack itself is the test of the repair. This works whether or not Chiru is holding publishes. For a database rule Chiru didn't close itself, the fix is a sentence to give IILA in chat.

You can read Chiru's last report any time: in the Studio's build panel, press Open Chiru's full report. The page lists every check by name with what happened to it (tried and nothing found, found, closed, or not run and why), and each finding with its proof and its fix. After a publish, the Studio's progress list also says how many checks ran and whether there is anything to look at.

Chiru's own rules

  • It attacks only your build's preview, never a live site.
  • Its test accounts are throwaway and are removed. Test rows it adds are removed. What it sends is a harmless marker, never something destructive.
  • Orders and messages it sends run in check mode: nothing is saved, charged or emailed.
  • It sends at most about 15 requests a second and stops at its time limit.
  • Every request it sends is logged with the report.

What Chiru does not do yet

  • The hunt covers your site's own API addresses. A flaw that lives only in a page's steps, such as two people booking the last slot at the same moment, is not hunted yet.
  • A finding in a database rule that Chiru couldn't close by itself is repaired by asking IILA in chat with the "Fix" line, not by the button.
  • Saved-script checks cover content the page loads in the browser. Content put into the page on the server is not covered yet.
  • Coupon and gift-card reuse across separate orders is not tested.
  • It checks websites. Phone apps are not attacked yet.
  • A check that can't run (for example, the preview is asleep) is listed as not run. It never holds a publish.

Chiru lowers risk; it can't promise a site has no holes. Keep your payment and email keys in Manage site, not in the code, and tell us at support-note@chirai.dev if you think it missed something or held a publish wrongly.