Skip to content

MEASUREMENT ONLY (proposed fix RETRACTED): declaring a read-only authorization block flips non-admin writes 201 -> 403 #319

Description

@rubenvdlinde

A regression introduced by #315 (the fleet-wide x-openregister.publicRead/publicWrite removal), found while measuring the same change in portaliq.

What happened

#315 replaced the bogus publicRead/publicWrite keys with real authorization blocks — but declared read only. All 29 hermiq schemas now look like:

"authorization": { "read": ["authenticated"] }

In OpenRegister a schema with no authorization block is default-open to the authenticated pseudo-group for writes (anonymous writes are separately fail-closed, openregister#1955). Declaring any block replaces that default — so a block with no create rule denies every non-admin write.

Isolated on a live rig

Same user, same schema, same request; the only variable is the block:

schema state non-admin POST
authorization: {"read": [...]} 403 does not have permission to create objects in schema …
no authorization block 201

Why this is worth fixing rather than keeping

The tightening may well be desirable — but it was not what #315 said it was doing. Its stated purpose was to express public read through the public group instead of a key with zero consumers. Removing non-admin write access across 29 schemas was an unreviewed side effect, and it is the kind that surfaces as "the app stopped working for normal users" rather than as a test failure, because most suites run as admin.

Suggested fix

Restore the prior behaviour exactly, then decide tightening separately:

"authorization": {
  "read":   [ ... unchanged ... ],
  "create": ["authenticated"],
  "update": ["authenticated"],
  "delete": ["authenticated"]
}

portaliq#146 does exactly this for its 13 schemas and verifies it as a pair — non-admin POST returns 400 (validation) rather than 403, and anonymous POST is still 403.

⚠️ Verify any bulk edit with a duplicate-key-detecting parser. json.load silently keeps the last of a repeated key, which is what let a malformed hermiq_register.json pass every check in the original sweep (openregister — json.load hides duplicate keys). The app ships tests/validate-json-strict.js; run it.

Also affected by the same sweep

nextcloud-app-template (#151), petstore (#53), spectr (#18) — same shape, smaller schema counts. portaliq is already fixed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

triageAwaiting triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions