Skip to content

fix(security): guest portal keys full object names (web-to-lead/case)#399

Merged
os-zhuang merged 1 commit into
mainfrom
fix/guest-portal-full-object-names
Jun 16, 2026
Merged

fix(security): guest portal keys full object names (web-to-lead/case)#399
os-zhuang merged 1 commit into
mainfrom
fix/guest-portal-full-object-names

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Web-to-Lead/Case guest profile granted INSERT on lead/case, but the anonymous public-form permission path checks the full crm_lead/crm_case — so the insert was denied. Use full names.

Verified end-to-end: anonymous POST /api/v1/forms/contact-us/submit → creates a crm_lead; /forms/supportcrm_case; guests still 401 on reads (INSERT-only enforced).

⚠️ Requires framework #1989 (public-form resolution fix) to be released — on published @9.8.0 the form still returns FORM_NOT_FOUND until HotCRM bumps.

🤖 Generated with Claude Code

…case)

The Web-to-Lead / Web-to-Case guest profile granted INSERT on `lead`/`case`, but
the anonymous public-form permission path checks the FULL object name
(`crm_lead`/`crm_case`) — so the short-name grant never matched and the anonymous
insert was denied ("not permitted for roles []"). Use full names.

(The short-name keys other profiles use resolve only on the authenticated path;
the explicit-permission-set path used for anonymous submissions does not namespace
short→full — tracked upstream in objectstack/framework#1989.)

Verified end-to-end: anonymous POST /api/v1/forms/contact-us/submit creates a
crm_lead; /forms/support creates a crm_case; guests still get 401 on reads.

NOTE: requires the framework fix objectstack/framework#1989 (public-form
resolution from flattened view metadata) to be released — until HotCRM bumps to
that release, the form still resolves as FORM_NOT_FOUND on published @9.8.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@os-zhuang
os-zhuang merged commit 19406c2 into main Jun 16, 2026
4 checks passed
@os-zhuang
os-zhuang deleted the fix/guest-portal-full-object-names branch June 16, 2026 22:37
os-zhuang added a commit that referenced this pull request Jun 17, 2026
All five RBAC profiles keyed their object grants by short names (`lead`,
`account`, `case`, …) — but the declared objects are `crm_lead`, `crm_account`,
`crm_case`, … The short names reference NO existing object, so the grants relied
on the authenticated path's namespace resolution and silently applied to nothing
on the anonymous / explicit-permission-set path (the same trap that blocked
web-to-lead until #399).

Convert all profile object keys to the full `crm_*` names. Framework
objectstack/framework#1997 now makes this a hard build error
(`validateCrossReferences` rejects grants on undefined objects), so this also
keeps HotCRM green once it bumps to a release containing that check.

verify green: validation ✓, typecheck ✓, build ✓, tests 17/17.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
xuyushun441-sys pushed a commit that referenced this pull request Jun 20, 2026
Promotes the in-tree 9.9.1 work to the latest 9.11 line. Bumps all
@objectstack/* to ^9.11.0 (manifest specVersion ^9.11.0, app 1.2.0).
Full pipeline green (validate + typecheck + build + 17 tests) and the seed
loads clean at boot with no runtime errors.

- Lifecycle freeze hooks (opportunity_lifecycle, quote_workflow) now exempt
  framework-managed columns (owner_id, updated_at, created_by, …) from the
  "closed record" field-freeze. 9.x re-stamps ownership/timestamps via
  beforeUpdate (post-seed ownership assignment), which the old guard rejected
  with `Attempted: owner_id, updated_at` on every closed/accepted record.
  Business-field edits on closed records stay blocked (verified: amount write
  on a closed-won opp → 400, next_step → 200).
- smoke.test.ts flow-count assertion relaxed to >= 16 (a pre-existing drift:
  the task reminder/recurrence flows pushed the total to 17 without updating
  the literal). Keeps green as flows are added.

Note: the namespace-prefixed profiles, removed field display-props, dropped
monthsBetween() validation, and case seed resolution/escalation_reason were
already landed on main (#399/#400, 9.8 upgrade, 88e9b91); this change is the
9.11 delta on top.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
xuyushun441-sys added a commit that referenced this pull request Jun 20, 2026
* chore(deps): upgrade ObjectStack 9.9.1 → 9.11 (1.2.0)

Promotes the in-tree 9.9.1 work to the latest 9.11 line. Bumps all
@objectstack/* to ^9.11.0 (manifest specVersion ^9.11.0, app 1.2.0).
Full pipeline green (validate + typecheck + build + 17 tests) and the seed
loads clean at boot with no runtime errors.

- Lifecycle freeze hooks (opportunity_lifecycle, quote_workflow) now exempt
  framework-managed columns (owner_id, updated_at, created_by, …) from the
  "closed record" field-freeze. 9.x re-stamps ownership/timestamps via
  beforeUpdate (post-seed ownership assignment), which the old guard rejected
  with `Attempted: owner_id, updated_at` on every closed/accepted record.
  Business-field edits on closed records stay blocked (verified: amount write
  on a closed-won opp → 400, next_step → 200).
- smoke.test.ts flow-count assertion relaxed to >= 16 (a pre-existing drift:
  the task reminder/recurrence flows pushed the total to 17 without updating
  the literal). Keeps green as flows are added.

Note: the namespace-prefixed profiles, removed field display-props, dropped
monthsBetween() validation, and case seed resolution/escalation_reason were
already landed on main (#399/#400, 9.8 upgrade, 88e9b91); this change is the
9.11 delta on top.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ci: raise Node floor to 22 for ObjectStack 9.11 (kysely@0.29)

driver-sql 9.11 pulls in kysely@0.29, which declares engines.node >=22.
With engine-strict=true, `pnpm install --frozen-lockfile` fails on the Node
20 CI matrix. Bumps ci.yml, code-quality.yml, release.yml, .nvmrc, and
package.json engines.node to 22 (the publish workflows already used 22).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ci(link-check): ignore release-tag links; add 1.2.0 changelog footer

CHANGELOG version footers point at /releases/tag/vX, which 404 until each
release is published (v1.0.0 was never cut) — they shouldn't gate CI. Adds
`releases` to the markdown-link-check ignore pattern and the [1.2.0] footer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant