/

CVE-2026-82492

CVE-2026-82492: The Deduplication Column That Reached the Same Private Key


CVE-2026-82492

CVSS:3.1

Hemanshu Baviskar

CONTENTS

0% READ
Xen: The first copy failed. The second skipped the check.

openIMIS ships a duplicate-beneficiary detection report that lets a caller group records by columns of their choosing. The columns arrive as dotted ORM paths, and the code that is supposed to vet them reads only the text before the first relation hop, confirms that one segment is a real column, and then hands the whole untouched path to the query. So user_created__i_user__private_key sails through on the strength of user_created alone, and the report groups beneficiaries by the JWT signing key of whoever created them. The feature's own count-greater-than-one filter is what pushes the secret into the response.

TL;DR

  • The defect. _resolve_columns in deduplication/services.py validates only column.split('__', 1)[0], the first segment of each dotted grouping path, then appends the entire path to the query. Everything after the first relation hop is never checked.

  • What it grants. An account holding exactly one narrow right, 170001, recovers another user's InteractiveUser.private_key, the HS256 secret openIMIS signs JWTs with, and forges a token as that user. In the lab a deduplication-only account became Admin.

  • The tell. The function's shape shows it meant to validate the column. It calls _is_model_column on purpose. It just validates a prefix and trusts the remainder, which is a missed step, not a design decision.

  • Reach. Stock backend code in openimis-be-deduplication_py. No non-default configuration required. The only precondition beyond the right is a benefit plan with two beneficiary records sharing a creator, which the grouping needs to surface anything at all.

  • Status. Reproduced on ghcr.io/openimis/openimis-be:develop. Fixed in the openIMIS 2026-10 release.

At a Glance

CVE

CVE-2026-82492

Product

openIMIS backend, openimis-be-deduplication_py (duplicate-beneficiary report)

Class

CWE-20, Improper Input Validation, leading to CWE-522, Insufficiently Protected Credentials

Root cause

Dotted grouping path validated on its first segment only, then used in full

Impact

JWT signing key disclosure and forgeable authentication as the key's owner

Affected

openIMIS before the 2026-10 release

Fixed

2026-10 release

Severity

8.8 CVSS 3.1 / 8.7 CVSS 4.0 (High)

Disclosure

Coordinated with openIMIS and VulnCheck

Credit

CodeAnt AI Security

A Report You Steer With Column Names

The deduplication module answers a mundane operational question: within a benefit plan, which beneficiary records look like duplicates of each other? The way it answers is to group records by a set of columns the caller names and return every group that has more than one member. Group by national id and date of birth, and two rows with the same id and birthday come back as a suspected duplicate. The columns are the knob the caller turns.

Those columns are Django ORM field paths, and field paths are not flat. A double-underscore is a relation hop: user_created is a column on Beneficiary, but user_created__i_user follows the foreign key to the InteractiveUser behind that creator, and user_created__i_user__private_key reads a column on that user. The grouping engine will follow a chain of hops across tables. That is the primitive the caller is handed: not a choice among a fixed list of fields, but the ability to describe an arbitrary traversal through the data model and have the report group by whatever it lands on.

A primitive like that is safe only while something stands between the caller's path and the query, deciding which traversals are allowed. openIMIS has that something. It is one function, and it checks one hop.

The Guard That Reads the First Word

The gatekeeper is _resolve_columns, and the shape of it tells you the author knew the input needed vetting. It loops over the caller's columns, tests each one, and keeps the ones that pass. The test is the problem.

# deduplication/services.py  (_resolve_columns, ~:347-356)
def _resolve_columns(model, columns):
    for column in columns:
        if _is_model_column(model, column.split('__', 1)[0]):  # checks ONLY the first segment
            fields.append(column)                               # appends the WHOLE dotted path
# deduplication/services.py  (_resolve_columns, ~:347-356)
def _resolve_columns(model, columns):
    for column in columns:
        if _is_model_column(model, column.split('__', 1)[0]):  # checks ONLY the first segment
            fields.append(column)                               # appends the WHOLE dotted path
# deduplication/services.py  (_resolve_columns, ~:347-356)
def _resolve_columns(model, columns):
    for column in columns:
        if _is_model_column(model, column.split('__', 1)[0]):  # checks ONLY the first segment
            fields.append(column)                               # appends the WHOLE dotted path

column.split('__', 1)[0] takes everything before the first double-underscore and nothing after it. For user_created__i_user__private_key that is user_created, which is a genuine column on Beneficiary, so _is_model_column returns true and the guard is satisfied. The line directly below then appends column, the full original string, relation hops and terminal credential column included. The validator and the value it guards have parted ways: one looked at user_created, the other carries user_created__i_user__private_key.

The resolved list feeds straight into the grouping query a few lines up:

# deduplication/services.py  (~:341)
queryset.values(*values).annotate(id_count=Count('id'), ids=ArrayAgg('id', distinct=True)).filter(id_count__gt=1)
# deduplication/services.py  (~:341)
queryset.values(*values).annotate(id_count=Count('id'), ids=ArrayAgg('id', distinct=True)).filter(id_count__gt=1)
# deduplication/services.py  (~:341)
queryset.values(*values).annotate(id_count=Count('id'), ids=ArrayAgg('id', distinct=True)).filter(id_count__gt=1)

values(*values) is where the traversal executes. Django resolves each path, joins across every relation hop it names, and selects the terminal column, so private_key comes back in the grouped output with everything else. Nothing between the split and the values ever reconsiders the part of the path that was skipped.

Why the Report Hands You the Secret

A disclosure bug usually has to work to get the secret into the response. This one is handed it by the feature's own purpose. The query ends in .filter(id_count__gt=1): return only groups with more than one member. That filter exists because a duplicate report is uninteresting for singletons. It is also exactly the condition that surfaces a signing key.

Records created by the same account all carry that account's user_created foreign key, and so they all resolve to the same private_key through the hop chain. Group two beneficiaries created by Admin on user_created__i_user__private_key, and they land in one group of size two, which clears the id_count > 1 bar, so the group is returned with its grouping value attached. The grouping value is the key.

In the lab, a request for the deduplication summary of a benefit plan, grouping on that single column, returned:

{"data":{"beneficiaryDeduplicationSummary":{"rows":[{"columnValues":
  "{\"user_created__i_user__private_key\": \"C1C224B03CD9BC7B6A86D77F5DACE40191766C485CD55DC48CAF9AC873335D6F\"}",
  "count":2}]}}}
{"data":{"beneficiaryDeduplicationSummary":{"rows":[{"columnValues":
  "{\"user_created__i_user__private_key\": \"C1C224B03CD9BC7B6A86D77F5DACE40191766C485CD55DC48CAF9AC873335D6F\"}",
  "count":2}]}}}
{"data":{"beneficiaryDeduplicationSummary":{"rows":[{"columnValues":
  "{\"user_created__i_user__private_key\": \"C1C224B03CD9BC7B6A86D77F5DACE40191766C485CD55DC48CAF9AC873335D6F\"}",
  "count":2}]}}}

That hex string is Admin's HS256 secret. openIMIS signs its authentication tokens with each user's private_key, so possession of the value is possession of the ability to mint that user's tokens. A token forged with it and presented to /api/core/users/current_user/ returned {"username":"Admin","i_user":{"id":1,...}}. The caller, who started with the single right 170001 and never knew Admin's password, is now Admin. The honest ceiling: this is credential disclosure escalating to full impersonation of the key's owner, bounded only by whose records share a creator inside a plan the caller can report on, which in practice includes administrative accounts.

The Path That Passes and the One That Does Not

The clearest way to see the defect is to line up the inputs the guard accepts against the one it would reject, because the accepted path is longer and more dangerous than the rejected one.

Grouping column

First segment checked

Guard verdict

What the query reads

national_id

national_id

real column, passes

the id field, as intended

not_a_field

not_a_field

not a column, rejected

nothing

not_a_field__i_user__private_key

not_a_field

not a column, rejected

nothing

user_created__i_user__private_key

user_created

real column, passes

the creator's signing key

The guard refuses not_a_field__i_user__private_key outright, because its first segment is not a column. It accepts user_created__i_user__private_key, because its first segment is. The only thing that distinguishes the credential-leaking input from the rejected one is that it begins with a word the guard likes. Everything load-bearing in the exploit lives in the part of the string the guard never reads.

A Twin Reached by Unrelated Code

CodeAnt reported a second openIMIS finding, CVE-2026-82491, that ends at the same InteractiveUser.private_key column and yields the same forged-token impersonation. It lives in the generic export feature, core/gql/export_mixin.py, which accepts unvalidated dotted field paths of its own. It is gated by a different right and shares no code with the deduplication report. Two independent features, written by presumably different hands, each decided for itself what a safe field path looks like, and each got it wrong in the same way.

That duplication is the credibility beat. A single oversight in one function is a bug. The same disclosure class reachable through two unrelated code paths, each with its own private notion of validation, is evidence that no review pass ever asked the codebase-wide question: where does caller-controlled ORM traversal reach a credential column? Neither path has a test exercising a multi-segment column value, so neither author had a check that would have caught the prefix-only validation. Patching deduplication alone leaves the export twin open. The real remediation is one shared validation routine both paths call, so "which traversals are allowed" is answered in one place.

Reach and Real-World Exposure

This is stock backend code in the deduplication module. There is no feature flag to turn off, no non-default deployment option that enables it, and no edge configuration involved. Any openIMIS instance running the module exposes the report, and the finding reproduces on current develop.

The precondition is modest. The caller needs the single right 170001, permission to run the deduplication summary, a narrow operational grant an organization would hand to data-quality staff, nothing resembling administrative access. Beyond the right, the caller needs a benefit plan with at least two beneficiary records that share a creator, so the count > 1 grouping returns a row. In any real deployment, records are created in bulk by a handful of service or administrative accounts, so creator-sharing is the normal state, not something the attacker has to engineer. We do not claim a count of exposed instances. We claim that where the module runs, a minimally privileged account reaches an administrative signing key through it.

Severity

Metric

Value

CVSS 3.1

8.8, CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

CVSS 4.0

8.7, CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

The report is network reachable over GraphQL, the attack is low complexity, and the only privilege required is the single right 170001, which is why privilege is Low rather than None. Recovering an administrator's signing key and forging that user's tokens is full compromise of the targeted account, so confidentiality, integrity, and availability all score High once the impersonation lands. It is not a 10.0: the attacker already holds a privileged account (PR:L), and Scope is Unchanged. The admin impersonation is the downstream consequence of the disclosure, reached by using the leaked key against the same application, not a formal crossing into a separate security authority, so the score caps where it does.

Detection and Fix

Upgrade. openIMIS addressed this in the 2026-10 release; upgrading is the durable remedy. The fix is a validation routine that walks the full dotted path rather than its first segment, resolving each hop against an explicit allow-list of traversable relations and terminal columns, shared by both the deduplication report and the export mixin. One place decides what is groupable and exportable, and credential columns such as private_key are never on the list.

If you cannot upgrade immediately, these reduce exposure, and each carries a cost, so validate before relying on any of them:

  • Restrict right 170001 to the smallest possible set of trusted accounts and audit who currently holds it. This shrinks the attacker population but does not close the path for anyone who legitimately needs the report.

  • Add a reject-list in front of the grouping query that drops any column whose path contains more than one segment, or that names a relation hop at all, until proper allow-list validation exists. This breaks any legitimate cross-relation grouping the module relies on, so confirm what the report actually needs first.

  • Rotate InteractiveUser.private_key values for administrative accounts on the assumption that any key reachable through this path should be treated as exposed. This invalidates outstanding tokens for those users.

Disclosure Timeline

Date

Event

2026-08-26

CodeAnt AI Security Research reported seven openIMIS findings (two Critical, five High) to VulnCheck for coordinated vulnerability disclosure.

2026-08-31

VulnCheck confirmed receipt and opened coordination with the openIMIS maintainers.

September 2026

openIMIS acknowledged the reports; the next release was in its UAT phase.

October 2026

openIMIS published the 2026-10 release.

2026-11-17

openIMIS maintainers confirmed that the 2026-10 release addresses all reported findings, and CVE records were drafted.

Credit and Scope

Finding

CodeAnt AI Security

What we claim

_resolve_columns validates only the first segment of a dotted grouping path and uses the full path, letting a holder of right 170001 recover an administrator's JWT signing key and authenticate as that user, reproduced to a benign marker on develop

What we do not claim

A count of exposed instances; runtime behavior on versions other than the tested develop image

Related

CVE-2026-82491, the export-feature twin reaching the same private_key through independent code, best fixed by one shared validator. CVE-2026-82489, an unauthenticated report-previewer RCE in the same product

Coordination

Reported to openIMIS; fixed in the 2026-10 release

More from CodeAnt

  • CVE-2026-82491: The Export Field Path That Walked to a Signing Key, the deduplication twin

  • CVE-2026-82489: The Report Previewer That Executed Anyone's Code, an unauthenticated openIMIS RCE

  • CVE-2026-71519: The Gate That Checked the Request, Not the Record, a PrestaShop account takeover

Find out what is already exploitable in your codebase. Book a demo or start a free trial at codeant.ai.

Frequently Asked
Questions
What is CVE-2026-82492?
Does this affect every openIMIS installation?
Does an attacker need an account?
Why does validating the first hop fail to protect the rest?
What can an attacker actually do with it?
How is this different from CVE-2026-82491?
How do I fix CVE-2026-82492?
Find out what's already
exploitable in your codebase.