Why securing midPoint expressions and scripts comes first
The risk is controlled by limiting who can author expressions, what those expressions can call, and which values are allowed to reach target systems. In a production midPoint, mappings, object templates and reports can contain Groovy or other scripts that read and write identity data, so a single poorly controlled expression can change accounts, roles or attributes across connected systems. This section sets the scope for the rest of the page: it covers configuration choices such as who holds permission to edit mappings and reports, which expression profiles apply, how provisioned values are constrained, and when to move to MEL. It does not cover code-level fixes to midPoint itself.
Teams need this work as soon as scripts are part of the live configuration, not only when a problem appears. Evolveum's security advisories include abuse of expressions embedded in midPoint reports to gain unauthorized access, which shows that report authors and anyone who can edit report definitions hold a privilege that can reach well beyond reporting. Before go-live, confirm which administrators and delegated roles can create or modify mappings, object templates, reports and function libraries, and whether any of them can run scripts with broader rights than their day-to-day work requires. Check the advisory list for the version you run, because the affected areas and fixes depend on the release.
The rest of this page works through those decisions in order: the expression profiles that restrict script capabilities, the authorization model for editing expression-bearing objects, the controls on values sent to target systems, and the options for replacing Groovy with MEL where it fits. Use the Evolveum security checklist as the baseline for your own review, and treat each item here as a decision your team records with an owner, not a default setting left in place.
Expression security options and when each fits
This table compares the main controls for limiting script and expression risk in midPoint, from restricting the language to restricting who can change mappings and reports. Read each row for the situation it fits, the flexibility it costs, and what it takes to operate. The main takeaway is that these controls layer, and that exact configuration keys must be confirmed against Evolveum's checklist and the release documentation for your version.
| Control | When it fits | Trade-off in flexibility | Operational cost |
|---|---|---|---|
| Expression profiles | Restricting which expression evaluators and script capabilities a given context may use, such as limiting mappings to a narrow set | Strongest restriction on what a script can do, but teams lose functions they may rely on | Profiles must be designed, assigned and tested per context; confirm the profile keys in the checklist for your release |
| Restricting script language to MEL | Mappings and reports that only need simple value transformations, where a less powerful language reduces exposure | Some logic written in Groovy may need rewriting, and complex conditions can become harder to express | One-time rewrite and retest of existing expressions; confirm which evaluators your release supports |
| Authorizations on mapping and report editing | Organizations where a small group of administrators should change expressions, and everyone else should only use them | Changes go through a narrower group, which slows routine fixes | Requires a role model for expression editors and periodic review of who holds those authorizations |
| Sanitizing values before provisioning | Values from HR or other sources that feed scripts or target systems, where unexpected characters or formats could alter behavior | Adds validation logic that can reject legitimate edge-case data | Ongoing maintenance as source data changes; needs test cases for malformed input |
| Separate review of report and mapping changes | Regulated environments where expression changes must be traced to an approved change | Slower delivery of expression changes | Change process, version control and evidence collection for each change |
| Limiting script use to reviewed function libraries | Shared logic that many mappings call, so one reviewed implementation replaces many inline scripts | Teams must request changes to shared functions instead of editing locally | Ownership and release process for the library; confirm how libraries are loaded in your version |
Where expression risk enters midPoint
Expressions and scripts in midPoint run with the permissions of the objects that contain them, so a small number of editing rights can reach far into the system. The four points below are where that risk usually enters, and each one connects back to the advisory listing abuse of expressions embedded in reports.
Report expressions reaching unauthorized data
Reports can contain expressions that run when a report is generated. The advisory lists abuse of expressions embedded in midPoint reports as a way to gain unauthorized access. Check who can create or edit report objects, which data sources each report reads, and whether a report author could run code that a normal report viewer could not. Treat report editing as an administrative capability, not a reporting task.
Advisories listMapping authors with broad rights
Mappings and object templates decide what values flow into users, roles and resources. Anyone who can edit them can change how every account is provisioned, so their rights matter as much as the rights of a full administrator. Inventory who holds permission to edit mappings, which authorizations they inherit through roles, and whether those rights extend to #all. Illustrative example: a mapping author who can add a role to every user has effectively administered the whole identity estate.
Script inputs from HR and provisioned data
Values from HR feeds, source systems and connected directories reach scripts as inputs. If a script builds a command, query or path from that text without checking it, data written by someone outside midPoint can change script behavior. Identify every expression that reads a source attribute, decide which fields are trusted, and check that the script treats them as data. Sanitize values before they are used in any construct that is interpreted.
Connector-facing values built by scripts
Scripts often compute the attributes midPoint sends to target systems, including account names, group memberships and entitlement values. A flaw in that logic can create accounts with unintended privileges in downstream systems, even when midPoint itself is locked down. List each script that produces a value for a connector, confirm the expected format, and test edge cases such as empty, very long or unexpected characters. Review these outputs with the same care as the connector configuration.
Moving from Groovy to MEL without breaking mappings
Moving from Groovy to MEL (midPoint Expression Language) reduces the script surface that an attacker or an careless editor can reach, and it starts with an inventory, not a rewrite. Export your midPoint objects from the repository and list every Groovy block in mappings, object templates, policy rules, reports, notification and task handlers, and function libraries. For each one, record the owner, what triggers it, its inputs and outputs, and whether it calls Java classes, reads other objects, or contacts an external service. Those last three traits usually decide how hard a rewrite will be. Evolveum's advisories include abuse of expressions embedded in reports, so reports deserve the first pass.
Some Groovy logic rarely maps cleanly to a simpler language: string parsing beyond basic concatenation, loops over multivalued attributes, lookups of other objects, date arithmetic, and calls into shared helper functions. Before you change anything, confirm which expression features MEL supports in the exact midPoint release you run, using the release documentation for that version, because supported functions change between releases. Mark each script as direct replacement, partial replacement, or stays in Groovy under a restrictive expression profile. Some scripts may need a design change in the role model or the source data rather than a new expression.
Treat the migration as a planned change with its own change record and approvals. Copy production to a non-production environment with representative data, including identities with empty attributes, multivalued values, and links that were recently deleted. Run the Groovy and MEL versions side by side, compare projected values and report output, and change one mapping at a time with a documented rollback. Keep the Groovy source until the new expression has passed testing, and remove it only after the expression profile blocks scripts that are no longer needed. Ask Evolveum or your partner to confirm any known behavioral differences for your release.
How to lock down expressions in a production midPoint
This sequence moves a midPoint deployment from unreviewed scripts to a controlled state where only named administrators can author expressions, reports are constrained by profiles, and each change is proven by a negative test. The output is a written inventory, a restricted authorization model and a tested evidence set that a security reviewer can repeat.
Inventory every expression and report
Export or list every mapping, object template, policy rule, report, and library function that contains a Groovy or other script expression, and record the object type, the owning resource or task, and the evaluator language. Include expressions held in custom GUI objects and in any function libraries loaded by the deployment. The step is complete when the team has a reviewed spreadsheet or repository file where each item has an owner, a purpose, and a note on whether it still runs in production. Confirm with your own environment's configuration exports, since the set is usually larger than teams expect.
Identify who can edit expressions today
For each object in the inventory, determine which accounts and roles can create, modify, or execute it. Review the roles and authorizations that grant access to reports, resources, and object templates, and flag any non-administrative role that includes broad read-write rights on those object types. Also check for Superuser holders, since they bypass scoped rules. The output is a list of accounts that can change executable logic, reviewed against your current directory groups so that the answer reflects who actually holds access.
Restrict authorizations to named administrators
Remove write access to reports, mappings, and related objects from roles that do not need it, and grant it only through a dedicated administration role assigned to a small group. Keep execution rights separate from authoring rights where your deployment allows it, so that a report author does not automatically gain the ability to run arbitrary logic against production data. The step is done when a test account with a non-administrative role cannot open the report editor or save a changed expression. Document the role names and assignees so the access review can check them later.
Apply expression profiles to restrict evaluators
Define expression profiles that limit which evaluators and script capabilities are permitted for each context, and assign them to the roles, tasks, or object types that need them. Start with the most restrictive profile that still lets each existing expression run, then widen it only for a documented need. Review the profile definitions against the Evolveum security checklist and the advisory on expressions embedded in reports. The check is that every expression in the inventory resolves to a named profile, and that an expression outside its profile fails with a clear error rather than executing.
Sanitize provisioned values before they reach targets
Add validation to mappings that build values sent to target systems, particularly values that originate from HR feeds, self-service forms, or other user-editable sources. Reject or normalize characters that could alter queries, commands, LDAP filters, or SQL statements in connectors, and cap value length and format where the target accepts it. Treat any value that a user can enter as untrusted input, even when a source system is considered trusted. The step is complete when test records with injection-style strings are rejected or escaped in the target, which the team confirms in a non-production environment.
Migrate suitable scripts to MEL
Review each Groovy expression in the inventory and identify those that only perform simple path access, string handling, conditionals, or lookups that the MEL expression language can express. Rewrite these in MEL, keep Groovy only where a function cannot be expressed otherwise, and move any remaining Groovy into a controlled function library with a named owner and version history. Re-run the same test data through the old and new expressions and compare outputs. The step is done when the list of remaining Groovy items is short, justified in writing, and each one is covered by a profile.
Verify with negative tests
Write a set of tests that attempt the actions the controls are meant to block, and run them in a non-production copy of the deployment after every change. Examples include a non-admin account trying to create a report that contains a script, a non-admin attempting to edit a mapping, a profile-restricted expression calling a forbidden evaluator, and a crafted HR or self-service value carrying injection characters. Each test should record the expected result and the observed result. The sequence is complete when all negative tests fail as intended, the results are stored with the change record, and the tests are repeated after each upgrade or new expression is added.
Where the trust boundaries sit around midPoint expressions
The diagram starts with a report or mapping author, who can save a script only after midPoint's authorization checks pass. An allowed edit then runs inside an expression profile, which limits the functions the engine may call before a value is computed. Sanitization must clean that value before a connector writes it to a target system. The dashed-looking path from authorization straight to the engine shows the main risk: if no profile is applied, the script runs with fewer limits. Check that every editing role is paired with a profile, and that sanitization covers each connector.
Trust boundaries from script authors to provisioned target systems.
Operational controls that keep expressions safe over time
Expression safety is not settled at go-live. Mappings, reports and the people who can edit them change over time, and each midPoint upgrade or patch can change how expressions behave. The cards below cover the controls that keep that risk visible and reviewed after the initial hardening work.
Change control for mappings and reports
Treat every mapping, object template and report that contains a script as code. Store the approved version in version control, require a second reviewer for changes, and deploy through a documented path to test and then production. Check that a report or mapping change cannot reach production without the same review as a configuration change. Ask whether any script changes were made directly in the production user interface, since those changes often bypass review.
Security checklistReview who can edit expressions
Edit rights to scripts are effectively code execution rights, so review them on a fixed schedule. List every role or authorization that can create or modify mappings, reports, and function libraries, and confirm each holder still needs it. Include administrators who hold broad rights through the superuser role, because they can edit scripts without any scoped grant. Remove rights from people who have changed teams or left.
Logging and audit of expression changes
Confirm that changes to expression-bearing objects are recorded with who made the change, when, and what changed. Route those audit records to a store that administrators of midPoint cannot quietly edit. Alert on changes to reports and mappings outside an approved change window, and periodically compare the live configuration with the version in version control to find drift.
Retesting after each upgrade or patch
Upgrades and patches can change expression evaluation, default profiles, or the handling of existing objects, so rerun your expression tests after every change. Build a set of test cases for each report and mapping that covers both expected results and attempts to reach data beyond the intended scope. Record the results before and after the upgrade so differences are explained rather than assumed to be fine.
Tying patches to the advisories page
Evolveum publishes a list of security advisories, and one of them covers abuse of expressions embedded in reports to gain unauthorized access. Check that list on a regular schedule and record which advisories apply to your version. When an advisory affects expressions or reports, schedule the patch or upgrade ahead of routine maintenance and retest the affected expressions as part of that change.
Security advisoriesQuestions teams ask about midPoint expression security
What does expression security work cost and what drives the effort?
The cost is mostly the time to inventory every script and expression, decide who should own each one, change the ones that run with too much power, and test the result. The main drivers are the number of mappings, reports and Groovy scripts in use, how many of them read or write sensitive attributes, how many scripts must move to MEL, and how much regression testing your provisioning flows need. Costs are one-time for the review and migration, then recurring for periodic re-review when new mappings are added. Ask any partner for a quote built from a written inventory, with each deliverable, the test scope and the handover for ongoing ownership listed separately.
How long does it take to secure midPoint expressions?
Duration depends on the same drivers as cost: the size of the inventory, the number of scripts that need rewriting, and how long testing takes against connected systems. A small deployment with few custom scripts moves through the work much faster than one with many reports and Groovy mappings spread across several resources. Your internal calendar also matters, since mapping owners and change approvers must review each change. Ask for a phased plan that separates the inventory, the high-risk fixes, the MEL migration and the retest, so each phase has its own agreed end point before work starts.
What does our internal team need to provide?
Your team needs to provide working access to the midPoint administration interface and its configuration objects, with an administrator role scoped to the review rather than unrestricted Superuser access. You also need a non-production environment that mirrors your production connectors and target systems, so changes can be tested without touching live accounts. Named mapping and report owners must be available to confirm what each expression should do, and a change approver must sign off fixes. Finally, provide a copy of your current configuration as code or exports, and a list of connected systems with their owners.
Can our own team secure midPoint expressions without a partner?
Yes, a capable midPoint team can do this in-house, and many teams should. The work requires knowledge of how midPoint evaluates expressions, how expression profiles restrict what scripts can call, and how mappings feed provisioned values into target systems. Teams often underestimate the testing load and the time needed to rewrite Groovy into MEL without breaking existing flows. A practical split is for your team to own the inventory, approvals and day-to-day ownership, and to bring in an outside engineer for the risky pieces. Check whether your staff have run a midPoint upgrade or a connector change before, since those tasks use the same test discipline.
Does an external security review add independent assurance?
An external review adds a second set of eyes that has not written the scripts, which helps find abuse paths your team has stopped seeing. DeployOpen tests applications and infrastructure and can review midPoint expression and report exposure as part of a security test, then deliver findings with fixes and a retest. DeployOpen does not issue audit reports or certifications. If an auditor needs formal assurance over access controls, that comes from an independent auditor or certification body, and your evidence from the review helps them. Ask the reviewer to state what was tested, what was not, and how retests are recorded.
Why does midPoint expression security matter now?
Expressions run with the power of the system that evaluates them, so a script that can be edited or injected by a less-trusted user can reach identity data and connected systems. Evolveum's security advisories include abuse of expressions embedded in midPoint reports to gain unauthorized access, which shows this is a real attack path rather than a theoretical one. Check the midPoint security advisories against your installed version, and review who can create or edit reports and mappings. Treat that edit right as a privileged permission in your access model.
Should we move from Groovy to MEL, and what does it take?
Moving to MEL (midPoint Expression Language) reduces the power of code that can run in your expressions, which is a strong reason to do it for expressions edited by many people. The work involves rewriting each Groovy script into the expression form midPoint supports, testing the output against the same inputs, and confirming that no required behavior is lost. Scripts that call external services or perform complex logic are the hardest to move, so plan those separately. Confirm in the midPoint security checklist and your version's documentation which expression types and profiles apply to your release.
Limits to confirm in your environment
The expression risks on this page depend on settings that change by release and by how your team has used scripting so far. The cards below list what to confirm with Evolveum documentation and with your own testing before you set a policy or start a migration.
Expression profile settings for your release
Expression profiles decide which evaluators, script languages and functions a given mapping, report or policy may use. The exact profile keys, their defaults and how they bind to users or roles are release-specific, so do not copy settings from a blog or an older deployment. Read the expression profile section for your exact midPoint version, then confirm in a staging instance that a restricted profile actually blocks the operation you meant to block. Record the profile name and the objects it is assigned to.
Security checklistScript languages still available
Confirm which scripting languages your installation accepts for mappings, reports and other expressions. Some languages may be disabled by default or may depend on the runtime you deploy, and the answer changes with the Java version your release supports. Test each language you intend to allow against your restricted profile, and remove any language nobody on the team uses. Treat a language that is available but unused as attack surface you have not justified.
MEL coverage for existing logic
Moving logic from Groovy to MEL reduces what a script can do, but MEL does not necessarily cover every function your current mappings call. Inventory each Groovy expression, list the library functions and object accesses it uses, and mark those without an equivalent. Some logic will need to move into a reviewed function library or a supported connector feature instead. Test each converted expression against known input values and compare outputs before you switch profiles.
Connector behavior with sanitized values
Sanitizing provisioned values, such as stripping characters or normalizing case, can change what a target system receives. Confirm how each connector handles the sanitized value for its attribute types, including multi-valued attributes, empty values and special characters that the target treats as delimiters. Run a reconciliation against a test target after each change, and compare what midPoint believes it wrote with what the target stores. Connector documentation for your version is the first source to check.
Connector docsReports and mappings created outside change control
Reports and mappings can be created or edited through the user interface by anyone with the right authorization, which may bypass your normal review. Query the repository for objects with recent modification metadata, compare them with your version-controlled configuration, and identify who holds the authorizations to edit them. Any object you cannot trace to an approved change should be reviewed, exported and either reviewed or removed before you rely on the expression profile.
Editors of mappings and reports
Confirm which roles and administrators can create or change expressions, and whether that permission is narrower than general administration. Expression editing rights are often granted through broad superuser or wildcard authorizations that were added for convenience. List every principal with the authorizations that allow expression changes, and check whether each one still needs them. Use an access review cycle to keep that list current.
What a scoped expression security engagement covers
A scoped expression security engagement starts with an inventory, because the risk sits in what already exists. DeployOpen would list every Groovy script, expression, function library reference and report definition in the midPoint configuration, then record for each one who can edit it, which object types it touches, whether it runs on user input or provisioned values, and which expression profile governs it today. The output is a register that the client's administrators can read without the engagement team present. Clients should confirm early that they can export the configuration objects in scope and that a non-production copy exists where changes can be tested before production. Scope, deliverables and timelines are agreed in writing before any work begins, and a quote follows from that written scope.
The configuration work follows the inventory and is usually the largest part of the effort. It covers defining expression profiles that restrict which script languages and functions each mapping or report may use, narrowing the authorizations that allow editing of mappings and reports, and sanitizing values before they reach target systems. The MEL migration is limited to the scripts the client agrees to convert, with each converted expression tested against the same input and output as the original. Effort rises with the number of scripts, how many depend on Groovy-only libraries, and how many target systems read the affected attributes. The client should ask the quote to separate these items and to state whether the migration covers every script or only an agreed subset.
The engagement closes with a retest of the same expression paths, using the inventory as the checklist, and a findings report that lists what changed, what remains and who owns each open item. The client keeps the configuration, the profiles and the register after the engagement ends. Recurring costs are the client's own: reviewing new scripts before deployment, rerunning the inventory after upgrades, and tracking Evolveum's security advisories for expression-related issues. Ask any provider to name these ongoing responsibilities in the written scope so they are not discovered after handover.
How DeployOpen approaches midPoint expression security
DeployOpen plans, implements and hardens midPoint inside your own infrastructure, so expression and script controls are designed around your administrators, your mappings and your target systems. The work is scoped in writing before it starts, and the result is documented so your security and identity teams can review it.
How we scope
- Inventory every Groovy script, mapping, report and function library that midPoint executes in your deployment.
- Identify which administrators, roles and self-service paths can create or edit expressions and reports today.
- Agree in writing which expression profiles, MEL migrations and provisioning value checks are in scope.
- Confirm the midPoint version, release line and upgrade path before any control is changed in production.
How we build
- Define expression profiles that restrict script capabilities for each group that needs to write expressions.
- Restrict who can edit mappings, object templates and reports through authorizations tested against real accounts.
- Add sanitization for provisioned values so attribute input cannot inject unintended expression content.
- Move suitable Groovy expressions to MEL where the target expression language supports the required logic.
How we hand over
- Deliver the expression profile configuration, authorization matrix and sanitization rules as version-controlled files.
- Document each remaining script, its owner, its purpose and the review step required before it changes.
- Walk your administrators through the change process for mappings, reports and function libraries.
- Provide a findings record that maps each control to the midPoint configuration that implements it.
How we support
- Engagements are fixed-scope, and ongoing support, upgrades and continuous testing are available as a retainer.
- Retest expression controls after each midPoint upgrade or security advisory that affects expressions or reports.
- Review new reports and mappings against the agreed profile before they reach production.
- Confirm with Evolveum which support subscription level fits your patching and bug resolution needs.

