Skip to content

rename_schema_field rekeys Core/System-protected fields with no protection check (same guard bypass) #2195

Closed

Description

@mstomar125

Summary

rename_schema_field validates only that the source field exists and the destination doesn't, never its protection level, so update_schema's rename_fields can rekey a Core/System-protected field and migrate all node data to the new key, corrupting a core type.

Failure scenario

handle_update_schema's Phase-0 namespace check (schema/mod.rs:716-721) only rejects renaming TO a bare name on a core type; renaming a Core field to a prefixed name is allowed. Calling update_schema with {"schema_id":"task","rename_fields":[{"from":"status","to":"custom:status"}]} passes that check, then rename_schema_field (schema.rs:544) performs no SchemaProtectionLevel check and migrates every task node's status property data to custom:status, rewriting the stored schema. The hardcoded TaskNodeBehavior and the frontend read properties.task.status, which is now missing, breaking status rendering/validation across all existing tasks. Same root cause as the remove_fields gap: the schema-mutation path never consults protection levels and never calls can_modify_field. A fix that only guards removal leaves this rename path independently exploitable.

Location

packages/core/src/services/node_service/schema.rs:557

Severity

important


Found via a full-repo adversarial bug sweep, independently verified by two separate skeptical reviewers reading the actual current code before filing.

Activity

  1. self-assigned this
    on Aug 21, 2026
  2. mstomar125 commented on Aug 27, 2026

    @mstomar125
    ContributorAuthor

    Fixed in #2304: added a protection-level guard (checked against SchemaProtectionLevel via can_delete_field/can_modify_field) to handle_update_schema's Phase 0 and to the NodeService::rename_schema_field/update_schema_field_friendly_name primitives, so a Core/System-protected field can no longer be removed, renamed, or relabeled through update_schema. Also moved rename-destination grammar validation ahead of the migration/persist step, so a malformed destination name is rejected before anything is written rather than after. Regression tests cover the removal, rename, friendly-name-relabel, and grammar-before-persist scenarios described here. PR is open for review, not yet merged.

  3. mstomar125 commented on Aug 27, 2026

    @mstomar125
    ContributorAuthor

    Fixed in PR #2304 (merged 7528411a), part of the same cluster as #2194. Closing — GitHub's auto-close only picked up the first issue in the PR's comma-separated closing list, closing the rest manually.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions