[GH-ISSUE #6634] [Bug] Case-insensitive native search drops an exact Greek sigma substring match #4016

Closed
opened 2026-10-31 00:46:04 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @coygeek on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/6634

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Native analysis or decompilation

Observed behavior

The production analysisSearchPredicate returns false for a default case-insensitive literal search with pattern Σ and value ΟΣ. The value contains that exact uppercase character. Switching only case_sensitive to true returns true; Unicode regex mode also returns true. The shared literal matcher can therefore remove a result when case sensitivity is relaxed.

This is a direct production-helper reproduction. Provider inventory acquisition, public CLI/MCP and real IDA/Kuna sessions were not executed; the provider reach below is source-derived.

Reproduction

The executed six-case source probe called this helper with literal insensitive, literal sensitive and regex insensitive modes. This reduced invocation adapts its import to the checkout root; it was not separately replayed:

node --import tsx --input-type=module <<'JS'
import { analysisSearchPredicate } from './src/domain/analysisSearch.ts';
for (const [pattern, value] of [['Σ', 'ΟΣ'], ['σ', 'ΟΣ'], ['ς', 'ΟΣ'], ['Σ', 'ΣA'], ['foo', 'FOO'], ['ΟΣ', 'ΟΣ']]) {
  const common = {pattern, document: undefined};
  console.log(JSON.stringify({pattern, value, actualContains: value.includes(pattern),
    literalInsensitive: analysisSearchPredicate({...common, mode: 'literal', case_sensitive: false})(value),
    literalSensitive: analysisSearchPredicate({...common, mode: 'literal', case_sensitive: true})(value),
    regexInsensitive: analysisSearchPredicate({...common, mode: 'regex', case_sensitive: false})(value)}));
}
JS

Expected behavior

A case-insensitive literal substring search should retain an exact-case literal match. The shared search contract defaults to literal mode with case_sensitive: false; the matcher documentation promises literal substring matching. Unicode's case-folding data maps both uppercase sigma and final sigma to ordinary lowercase sigma.

Impact and scope

P2: valid Greek string/symbol searches can omit matching entries. One six-case matrix was run; the Σ/ΟΣ and σ/ΟΣ cases failed in insensitive literal mode while the ASCII, standalone-sigma and whole-word controls matched. Frequency in real binaries is unknown.

Source-derived reach: IDA filtering, Kuna procedure filtering, and Kuna string filtering call this helper. No claim is made about other providers' matching implementations.

REA version

Package 6.7.0; main source 3ed9f4b7e4ccd5b009bfbe6cf80383165199530b. Latest published package 6.7.0 was checked; the identified source helper was executed, not the npm artifact.

Runtime and platform

Node.js v24.22.1; Linux x86_64. Checkout's locked dependencies and tsx; no external analysis engine.

Target and artifact context

Literal Unicode strings only; no binary or external target was opened.

Interface

Other

Production shared domain matcher; provider consumers identified through source.

Earliest failure stage

Native analysis or reconstruction

Relevant output or evidence

First three observed matrix rows:

{"pattern":"Σ","value":"ΟΣ","actualContains":true,"literalInsensitive":false,"literalSensitive":true,"regexInsensitive":true}
{"pattern":"σ","value":"ΟΣ","actualContains":false,"literalInsensitive":false,"literalSensitive":false,"regexInsensitive":true}
{"pattern":"ς","value":"ΟΣ","actualContains":false,"literalInsensitive":true,"literalSensitive":false,"regexInsensitive":true}

The remaining controls returned true in insensitive literal mode for Σ/ΣA, foo/FOO, and ΟΣ/ΟΣ. The probe directly imported and executed the production function. No public-interface or real-provider result is claimed.

Typed outcome or recovery expected

Retain the matching result under the default insensitive literal query. The helper's case_sensitive: true and mode: "regex" controls found the demonstrated exact match; their complete provider workflows were not tested.

Analysis or suspected cause

Source-derived: the literal branch lowercases the pattern and candidate independently. Unicode lowercasing is contextual: a word-final uppercase sigma becomes ς, while the standalone search sigma becomes σ. Lowercasing both strings is not equivalent to case-insensitive substring matching.

Additional context

Prepared with AI assistance. NOT_ENOUGH_INFO: first affected release, real-binary prevalence and provider end-to-end scope were not established. No production files were changed.

Triage assessment

  • Impact level: P2
  • Assessment status: supported
  • Impact basis: The executed production matcher dropped an exact substring match when case sensitivity was disabled; documented native search consumers use that literal branch.
  • Workaround status: available
  • Workaround basis: In the same helper-level probe, explicitly case-sensitive and Unicode-regex queries retained the demonstrated match. Their public provider workflows were not executed.
Originally created by @coygeek on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/6634 ## Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ## Area Native analysis or decompilation ## Observed behavior The production `analysisSearchPredicate` returns false for a default case-insensitive literal search with pattern `Σ` and value `ΟΣ`. The value contains that exact uppercase character. Switching only `case_sensitive` to true returns true; Unicode regex mode also returns true. The shared literal matcher can therefore remove a result when case sensitivity is relaxed. This is a direct production-helper reproduction. Provider inventory acquisition, public CLI/MCP and real IDA/Kuna sessions were not executed; the provider reach below is source-derived. ## Reproduction The executed six-case source probe called this helper with literal insensitive, literal sensitive and regex insensitive modes. This reduced invocation adapts its import to the checkout root; it was not separately replayed: ```sh node --import tsx --input-type=module <<'JS' import { analysisSearchPredicate } from './src/domain/analysisSearch.ts'; for (const [pattern, value] of [['Σ', 'ΟΣ'], ['σ', 'ΟΣ'], ['ς', 'ΟΣ'], ['Σ', 'ΣA'], ['foo', 'FOO'], ['ΟΣ', 'ΟΣ']]) { const common = {pattern, document: undefined}; console.log(JSON.stringify({pattern, value, actualContains: value.includes(pattern), literalInsensitive: analysisSearchPredicate({...common, mode: 'literal', case_sensitive: false})(value), literalSensitive: analysisSearchPredicate({...common, mode: 'literal', case_sensitive: true})(value), regexInsensitive: analysisSearchPredicate({...common, mode: 'regex', case_sensitive: false})(value)})); } JS ``` ## Expected behavior A case-insensitive literal substring search should retain an exact-case literal match. The [shared search contract](https://github.com/morluto/rea/blob/3ed9f4b7e4ccd5b009bfbe6cf80383165199530b/src/contracts/analysisSearchContract.ts#L4-L11) defaults to literal mode with `case_sensitive: false`; the [matcher documentation](https://github.com/morluto/rea/blob/3ed9f4b7e4ccd5b009bfbe6cf80383165199530b/src/domain/analysisSearch.ts#L11-L14) promises literal substring matching. Unicode's [case-folding data](https://www.unicode.org/Public/UCD/latest/ucd/CaseFolding.txt) maps both uppercase sigma and final sigma to ordinary lowercase sigma. ## Impact and scope P2: valid Greek string/symbol searches can omit matching entries. One six-case matrix was run; the `Σ`/`ΟΣ` and `σ`/`ΟΣ` cases failed in insensitive literal mode while the ASCII, standalone-sigma and whole-word controls matched. Frequency in real binaries is unknown. Source-derived reach: [IDA filtering](https://github.com/morluto/rea/blob/3ed9f4b7e4ccd5b009bfbe6cf80383165199530b/src/ida/IdaOperationRunner.ts#L593-L600), [Kuna procedure filtering](https://github.com/morluto/rea/blob/3ed9f4b7e4ccd5b009bfbe6cf80383165199530b/src/kuna/KunaSessionClient.ts#L790-L804), and [Kuna string filtering](https://github.com/morluto/rea/blob/3ed9f4b7e4ccd5b009bfbe6cf80383165199530b/src/kuna/KunaStringQueries.ts#L84-L97) call this helper. No claim is made about other providers' matching implementations. ## REA version Package 6.7.0; main source `3ed9f4b7e4ccd5b009bfbe6cf80383165199530b`. Latest published package 6.7.0 was checked; the identified source helper was executed, not the npm artifact. ## Runtime and platform Node.js v24.22.1; Linux x86_64. Checkout's locked dependencies and tsx; no external analysis engine. ## Target and artifact context Literal Unicode strings only; no binary or external target was opened. ## Interface Other Production shared domain matcher; provider consumers identified through source. ## Earliest failure stage Native analysis or reconstruction ## Relevant output or evidence First three observed matrix rows: ```json {"pattern":"Σ","value":"ΟΣ","actualContains":true,"literalInsensitive":false,"literalSensitive":true,"regexInsensitive":true} {"pattern":"σ","value":"ΟΣ","actualContains":false,"literalInsensitive":false,"literalSensitive":false,"regexInsensitive":true} {"pattern":"ς","value":"ΟΣ","actualContains":false,"literalInsensitive":true,"literalSensitive":false,"regexInsensitive":true} ``` The remaining controls returned true in insensitive literal mode for `Σ`/`ΣA`, `foo`/`FOO`, and `ΟΣ`/`ΟΣ`. The probe directly imported and executed the production function. No public-interface or real-provider result is claimed. ## Typed outcome or recovery expected Retain the matching result under the default insensitive literal query. The helper's `case_sensitive: true` and `mode: "regex"` controls found the demonstrated exact match; their complete provider workflows were not tested. ## Analysis or suspected cause Source-derived: [the literal branch](https://github.com/morluto/rea/blob/3ed9f4b7e4ccd5b009bfbe6cf80383165199530b/src/domain/analysisSearch.ts#L28-L32) lowercases the pattern and candidate independently. Unicode lowercasing is contextual: a word-final uppercase sigma becomes `ς`, while the standalone search sigma becomes `σ`. Lowercasing both strings is not equivalent to case-insensitive substring matching. ## Additional context Prepared with AI assistance. NOT_ENOUGH_INFO: first affected release, real-binary prevalence and provider end-to-end scope were not established. No production files were changed. ## Triage assessment - Impact level: P2 - Assessment status: supported - Impact basis: The executed production matcher dropped an exact substring match when case sensitivity was disabled; documented native search consumers use that literal branch. - Workaround status: available - Workaround basis: In the same helper-level probe, explicitly case-sensitive and Unicode-regex queries retained the demonstrated match. Their public provider workflows were not executed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#4016
No description provided.