Repository navigation
fix(check): report a microflow without entity access calling one with it, MDL-SEC22 (mendixlabs/mxcli#1500) - #1388
Merged
Merged
Conversation
… it, MDL-SEC22 (mendixlabs#1500) No check modelled CE0114 "A microflow that does not apply entity access can only call microflows that also do not apply entity access" - a consistency rule between two documents, not a reference - so `check -p --references` passed and mxbuild refused. CheckEntityAccessCalls simulates stored and scripted microflows/rules (carriedApplyEntityAccess for absent annotations), reports new off->on calls and off->rule-on decisions as errors, stays silent on unresolved callees. Measured on mxbuild 11.13.0/11.14.0: reverse, on->on, off->off, nanoflow and excluded callers build clean, at Off and Prototype. Two variants on a fresh 11.14 project: issue script -> MDL-SEC22 exit 1, exec -> 1x CE0114; caller fixed -> check passes, 0 errors. Revert-proof: gate stubbed -> 6 tests fail "got 0"; callee test dropped -> off->off control fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VKmbj53BC2vuUWYmgWgfQ5
The index on main is stale (make check-skill-index fails on every branch); regenerated here so this PR's CI is green. A no-op once main carries it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VKmbj53BC2vuUWYmgWgfQ5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes mendixlabs#1500.
Reported symptom
mxbuild (11.14.0) refuses with
while
check -p --referencesprinted "no flow change exec would refuse … no used flow left without access" and "Check passed!".Measured (fresh
mxcli newprojects, 11.13.0 and 11.14.0)Fires at security level Off and Prototype alike, so the rule is an error regardless of level.
Fix
New
mdl/executor/validate_entity_access_calls.go(MDL-SEC22), wired into the project checks incmd/mxcli/cmd_check.go:@applyentityaccesskeeps the stored setting, through the same function exec uses;Gating: not version-gated (judgment call) — it predicts a build error and exec does not refuse on it, the same choice MDL-SEC21 made for CE0106.
Tests
10 executor tests (MockBackend) in
validate_entity_access_calls_test.go: both reported shapes, the clean directions, an unresolved callee, rule decisions, nanoflow and excluded callers, omitted annotations, the script changing the callee, an existing problem left alone, andalter … insert.Proof by revert: with the check disabled, 6 positive tests fail with "got 0"; removing the callee-setting resolution fails the off→off control.
Two-variant mxbuild run (fresh 11.14 project, callee stored)
checkreports MDL-SEC22 and exits 1; exec'd anyway,mxcli docker checkreports 1× CE0114.@applyentityaccess(true):checkpasses;docker checkreports 0 errors.mdl-examples/bug-tests/1500-entity-access-call-mismatch.mdlyields exactly one MDL-SEC22 and one CE0114.Also
docs-site/src/appendixes/error-messages.mdsection,pitfalls.mdnote..claude/skills/mendix/check-syntax/reference/cross-document-flow-rules.md(the skill body cap).manage-navigation/SKILL.md's line index, which is stale onmainand would failmake check-skill-indexon every PR (no-op once main carries it).Validation
go test ./...(see note),make check-mdl,make check-findings,make check-conformance,make lint-go,check-skill-indexpass. Note: locallyTestSyncCompaniononly failed because the rsync-less sandbox copiedmods/tests into the embed dir; it passes once pruned as the Makefile fallback does. No describe/writer change, so roundtrip not run.Not covered
A call that
alter microflowremoves is not tracked (only added calls); excluded callees not judged (not measured).🤖 Generated with Claude Code
https://claude.ai/code/session_01VKmbj53BC2vuUWYmgWgfQ5
Generated by Claude Code