Firmware patcher for Xiaomi routers
This report summarizes scanner evidence for openwrt-xiaomi/xmir-patcher, a Python project with 3,636 GitHub stars. SynthScan examined 17,709 lines of code across 103 source files, recording 379 pattern matches distributed across 11 syntactic categories. The legacy adjusted pattern signal is 27.7 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 101 finding(s).
Are imports declared and package/API names verified? 143 finding(s).
Are wrappers, guards, and repeated structures necessary? 138 finding(s).
Which changes need focused human review? 379 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 379 distinct pattern matches across 11 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | shexec.py | 4 | CODE | |
| LOW | shexec.py | 5 | CODE | |
| LOW | shexec.py | 7 | CODE | |
| LOW | shexec.py | 8 | CODE | |
| LOW | shexec.py | 9 | CODE | |
| LOW | shexec.py | 10 | CODE | |
| LOW | shexec.py | 11 | CODE | |
| LOW | install_lang.py | 10 | CODE | |
| LOW | install_lang.py | 12 | CODE | |
| LOW | devtree.py | 6 | CODE | |
| LOW | gateway.py | 11 | CODE | |
| LOW | gateway.py | 20 | CODE | |
| LOW | gateway.py | 22 | CODE | |
| LOW | gateway.py | 23 | CODE | |
| LOW | gateway.py | 839 | CODE | |
| LOW | xqimage.py | 7 | CODE | |
| LOW | xqimage.py | 11 | CODE | |
| LOW | xqimage.py | 12 | CODE | |
| LOW | xqimage.py | 32 | CODE | |
| LOW | po2lmo.py | 3 | CODE | |
| LOW | po2lmo.py | 5 | CODE | |
| LOW | envbuffer.py | 4 | CODE | |
| LOW | envbuffer.py | 5 | CODE | |
| LOW | envbuffer.py | 6 | CODE | |
| LOW | envbuffer.py | 7 | CODE | |
| LOW | connect.py | 4 | CODE | |
| LOW | connect.py | 6 | CODE | |
| LOW | connect.py | 8 | CODE | |
| LOW | connect.py | 9 | CODE | |
| LOW | connect.py | 28 | CODE | |
| LOW | install_bl.py | 7 | CODE | |
| LOW | connect3.py | 4 | CODE | |
| LOW | connect3.py | 5 | CODE | |
| LOW | connect3.py | 7 | CODE | |
| LOW | connect3.py | 8 | CODE | |
| LOW | connect3.py | 9 | CODE | |
| LOW | connect3.py | 11 | CODE | |
| LOW | connect3.py | 12 | CODE | |
| LOW | connect3.py | 15 | CODE | |
| LOW | connect3.py | 16 | CODE | |
| LOW | connect3.py | 17 | CODE | |
| LOW | connect3.py | 18 | CODE | |
| LOW | connect3.py | 19 | CODE | |
| LOW | connect7.py | 8 | CODE | |
| LOW | connect7.py | 9 | CODE | |
| LOW | connect7.py | 112 | CODE | |
| LOW | connect6.py | 4 | CODE | |
| LOW | connect6.py | 9 | CODE | |
| LOW | connect6.py | 10 | CODE | |
| LOW | lmo2po.py | 3 | CODE | |
| LOW | read_dmesg.py | 5 | CODE | |
| LOW | read_dmesg.py | 6 | CODE | |
| LOW | read_dmesg.py | 8 | CODE | |
| LOW | read_dmesg.py | 10 | CODE | |
| LOW | connect2.py | 4 | CODE | |
| LOW | connect2.py | 5 | CODE | |
| LOW | connect2.py | 6 | CODE | |
| LOW | connect2.py | 7 | CODE | |
| LOW | connect2.py | 8 | CODE | |
| LOW | connect2.py | 9 | CODE | |
| 79 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | gateway.py | 216 | except Exception: | CODE |
| HIGH | gateway.py | 524 | except Exception: | CODE |
| HIGH | gateway.py | 689 | except Exception: | CODE |
| HIGH | gateway.py | 693 | except Exception: | CODE |
| HIGH | gateway.py | 778 | except Exception: | CODE |
| HIGH | gateway.py | 782 | except Exception: | CODE |
| HIGH | gateway.py | 142 | except Exception: | CODE |
| HIGH | gateway.py | 538 | except Exception: | CODE |
| HIGH | gateway.py | 797 | except Exception: | CODE |
| HIGH | gateway.py | 918 | except Exception: | CODE |
| HIGH | gateway.py | 1035 | except Exception: | CODE |
| HIGH | gateway.py | 534 | except Exception: | CODE |
| HIGH | gateway.py | 909 | except Exception: | CODE |
| HIGH | gateway.py | 1097 | except Exception: | CODE |
| HIGH | gateway.py | 1154 | except Exception: | CODE |
| HIGH | read_info.py | 658 | except Exception: | CODE |
| HIGH | read_info.py | 668 | except Exception: | CODE |
| HIGH | connect5.py | 266 | except Exception: | CODE |
| HIGH | install_fw.py | 412 | except ValueError: | CODE |
| HIGH | install_fw.py | 107 | except Exception: | CODE |
| HIGH | activate_boot.py | 136 | except Exception: | CODE |
| HIGH | activate_boot.py | 121 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | gateway.py | 775 | def ssh_close(self): | CODE |
| MEDIUM | gateway.py | 828 | def check_telnet(self, timeout = 2, port = 23, verbose = 0): | CODE |
| LOW⚡ | gateway.py | 516 | except Exception as e: | CODE |
| LOW⚡ | gateway.py | 524 | except Exception: | CODE |
| LOW⚡ | gateway.py | 534 | except Exception: | CODE |
| LOW⚡ | gateway.py | 538 | except Exception: | CODE |
| LOW⚡ | gateway.py | 680 | except Exception as e: | CODE |
| LOW⚡ | gateway.py | 685 | except Exception as e: | CODE |
| LOW⚡ | gateway.py | 689 | except Exception: | CODE |
| LOW⚡ | gateway.py | 693 | except Exception: | CODE |
| LOW⚡ | gateway.py | 903 | except Exception as e: | CODE |
| LOW⚡ | gateway.py | 909 | except Exception: | CODE |
| LOW⚡ | gateway.py | 918 | except Exception: | CODE |
| LOW⚡ | gateway.py | 926 | except Exception: | CODE |
| LOW | gateway.py | 142 | except Exception: | CODE |
| LOW | gateway.py | 155 | except Exception: | CODE |
| LOW | gateway.py | 189 | except Exception as e: | CODE |
| LOW | gateway.py | 216 | except Exception: | CODE |
| LOW | gateway.py | 253 | except Exception: | CODE |
| LOW | gateway.py | 326 | except Exception: | CODE |
| LOW | gateway.py | 665 | except Exception: | CODE |
| LOW | gateway.py | 778 | except Exception: | CODE |
| LOW | gateway.py | 782 | except Exception: | CODE |
| LOW | gateway.py | 797 | except Exception: | CODE |
| LOW | gateway.py | 809 | except Exception as e: | CODE |
| LOW | gateway.py | 821 | except Exception as e: | CODE |
| LOW | gateway.py | 833 | except Exception as e: | CODE |
| LOW | gateway.py | 842 | except Exception as e: | CODE |
| LOW | gateway.py | 874 | except Exception as e: | CODE |
| LOW | gateway.py | 981 | except Exception as e: | CODE |
| LOW | gateway.py | 1025 | except Exception as e: | CODE |
| LOW | gateway.py | 1035 | except Exception: | CODE |
| LOW | gateway.py | 1097 | except Exception: | CODE |
| LOW | gateway.py | 1154 | except Exception: | CODE |
| LOW | connect.py | 74 | except Exception: | CODE |
| LOW | connect3.py | 203 | except Exception as e: | CODE |
| MEDIUM | connect3.py | 194 | def device_factory_reset(timeout = 17, format_user_data = False): | CODE |
| LOW | connect7.py | 29 | except Exception: | CODE |
| LOW | connect7.py | 253 | except Exception: | STRING |
| LOW⚡ | read_info.py | 658 | except Exception: | CODE |
| LOW⚡ | read_info.py | 668 | except Exception: | CODE |
| LOW⚡ | read_info.py | 676 | except Exception: | CODE |
| LOW⚡ | read_info.py | 682 | except Exception: | CODE |
| LOW | read_info.py | 115 | except Exception: | CODE |
| LOW | read_info.py | 449 | except Exception: | CODE |
| LOW | read_info.py | 531 | except Exception: | CODE |
| LOW | read_info.py | 591 | except Exception: | CODE |
| LOW | read_info.py | 731 | except Exception: | CODE |
| LOW | read_info.py | 773 | except Exception: | CODE |
| LOW | read_info.py | 872 | except Exception: | CODE |
| LOW | read_info.py | 942 | except Exception: | CODE |
| LOW | read_info.py | 1007 | except Exception: | CODE |
| LOW | read_info.py | 1103 | except Exception: | CODE |
| LOW | connect5.py | 72 | except Exception as e: | CODE |
| LOW | connect5.py | 84 | except Exception: | CODE |
| LOW | connect5.py | 137 | except Exception: | CODE |
| LOW | connect5.py | 155 | except Exception: | CODE |
| LOW | connect5.py | 170 | except Exception: | CODE |
| LOW | connect5.py | 261 | except Exception: | CODE |
| LOW | connect5.py | 266 | except Exception: | CODE |
| 39 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | devtree.py | 52 | CODE | |
| LOW | devtree.py | 124 | CODE | |
| LOW | gateway.py | 280 | CODE | |
| LOW | gateway.py | 483 | CODE | |
| LOW | gateway.py | 697 | CODE | |
| LOW | gateway.py | 947 | CODE | |
| LOW | gateway.py | 1042 | CODE | |
| LOW | gateway.py | 1104 | CODE | |
| LOW | gateway.py | 1195 | CODE | |
| LOW | xqimage.py | 184 | CODE | |
| LOW | po2lmo.py | 128 | CODE | |
| LOW | po2lmo.py | 182 | CODE | |
| LOW | lmo2po.py | 71 | CODE | |
| LOW | lmo2po.py | 89 | CODE | |
| LOW | read_info.py | 133 | CODE | |
| LOW | read_info.py | 161 | CODE | |
| LOW | read_info.py | 268 | CODE | |
| LOW | read_info.py | 329 | CODE | |
| LOW | read_info.py | 824 | CODE | |
| LOW | install_fw.py | 234 | CODE | |
| LOW | install_fw.py | 316 | CODE | |
| LOW | install_fw.py | 416 | CODE | |
| LOW | install_fw.py | 839 | CODE | |
| LOW | install_fw.py | 1027 | CODE | |
| LOW | xmir_base/fdt/__init__.py | 400 | CODE | |
| LOW | xmir_base/fdt/__init__.py | 545 | CODE | |
| LOW | xmir_base/fdt/__init__.py | 608 | CODE | |
| LOW | xmir_base/fdt/__init__.py | 91 | CODE | |
| LOW | xmir_base/fdt/__init__.py | 198 | CODE | |
| LOW | xmir_base/fdt/__init__.py | 258 | CODE | |
| LOW | xmir_base/fdt/items.py | 582 | CODE | |
| LOW | xmir_base/fdt/items.py | 680 | CODE | |
| LOW | xmir_base/fdt/__main__.py | 164 | CODE | |
| LOW | xmir_base/ubireader/utils.py | 26 | CODE | |
| LOW | xmir_base/ubireader/utils.py | 84 | CODE | |
| LOW | xmir_base/ubireader/debug.py | 36 | CODE | |
| LOW | xmir_base/ubireader/ubi/display.py | 111 | CODE | |
| LOW | xmir_base/ubireader/ubi/display.py | 136 | CODE | |
| LOW | xmir_base/ubireader/ubi/block/sort.py | 91 | CODE | |
| LOW | xmir_base/ubireader/ubi/block/__init__.py | 106 | CODE | |
| LOW | xmir_base/ubireader/ubi/block/__init__.py | 160 | CODE | |
| LOW | xmir_base/ubireader/ubifs/list.py | 129 | CODE | |
| LOW | xmir_base/ubireader/ubifs/list.py | 146 | CODE | |
| LOW | xmir_base/ubireader/ubifs/display.py | 29 | CODE | |
| LOW | xmir_base/ubireader/ubifs/display.py | 44 | CODE | |
| LOW | xmir_base/ubireader/ubifs/display.py | 72 | CODE | |
| LOW | xmir_base/ubireader/ubifs/walk.py | 25 | CODE | |
| LOW | xmir_base/ubireader/ubifs/output.py | 61 | CODE | |
| LOW | xmir_base/ubireader/ubifs/output.py | 175 | CODE | |
| LOW | xmir_base/ubireader/scripts/ubireader_display_info.py | 34 | CODE | |
| LOW | xmir_base/ubireader/scripts/ubireader_list_files.py | 36 | CODE | |
| LOW | xmir_base/ubireader/scripts/ubireader_display_blocks.py | 36 | CODE | |
| LOW | xmir_base/ubireader/scripts/ubireader_utils_info.py | 50 | CODE | |
| LOW | xmir_base/ubireader/scripts/ubireader_utils_info.py | 140 | CODE | |
| LOW | xmir_base/ubireader/scripts/ubireader_utils_info.py | 164 | CODE | |
| LOW | xmir_base/ubireader/scripts/ubireader_extract_images.py | 41 | CODE | |
| LOW | xmir_base/ubireader/scripts/ubireader_extract_files.py | 47 | CODE | |
| LOW | xmir_base/telnetlib/telnetlib.py | 292 | CODE | |
| LOW | xmir_base/telnetlib/telnetlib.py | 422 | CODE | |
| LOW | xmir_base/telnetlib/telnetlib.py | 535 | CODE | |
| 1 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | xmir_base/fdt/misc.py | 1 | # Copyright 2017 Martin Olejar | COMMENT |
| LOW | xmir_base/fdt/header.py | 1 | # Copyright 2017 Martin Olejar | COMMENT |
| LOW | xmir_base/fdt/__init__.py | 1 | # Copyright 2017 Martin Olejar | COMMENT |
| LOW | xmir_base/fdt/items.py | 1 | # Copyright 2017 Martin Olejar | COMMENT |
| LOW | xmir_base/fdt/__main__.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/utils.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/debug.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/settings.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubi_io.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubi/__init__.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubi/display.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubi/volume.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubi/defines.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubi/defines.py | 21 | # the GNU General Public License for more details. | COMMENT |
| LOW | xmir_base/ubireader/ubi/headers.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubi/image.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubi/block/layout.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubi/block/sort.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubi/block/__init__.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubifs/misc.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubifs/list.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubifs/__init__.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubifs/display.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubifs/walk.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubifs/defines.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubifs/defines.py | 21 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | COMMENT |
| LOW | xmir_base/ubireader/ubifs/nodes.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/ubifs/output.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/scripts/ubireader_display_info.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/scripts/ubireader_list_files.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/scripts/ubireader_display_blocks.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/scripts/ubireader_utils_info.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/scripts/ubireader_extract_images.py | 1 | #!/usr/bin/env python | COMMENT |
| LOW | xmir_base/ubireader/scripts/ubireader_extract_files.py | 1 | #!/usr/bin/env python | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | gateway.py | 519 | #=============================================================================== | COMMENT |
| MEDIUM⚡ | gateway.py | 528 | #=============================================================================== | COMMENT |
| MEDIUM | gateway.py | 590 | #=============================================================================== | COMMENT |
| MEDIUM | gateway.py | 615 | #=============================================================================== | COMMENT |
| MEDIUM | gateway.py | 632 | #=============================================================================== | COMMENT |
| MEDIUM | gateway.py | 653 | #=============================================================================== | COMMENT |
| MEDIUM | gateway.py | 1359 | #=============================================================================== | COMMENT |
| MEDIUM | gateway.py | 1429 | #=============================================================================== | COMMENT |
| MEDIUM | install_fw.py | 1142 | # ===================================================================== | COMMENT |
| MEDIUM | install_ssh.py | 141 | # --------------------------------------------------------------------------- | STRING |
| MEDIUM | install_ssh.py | 195 | # --------------------------------------------------------------------------- | STRING |
| MEDIUM | xmir_base/ubireader/ubi/defines.py | 9 | # -------------------------- | COMMENT |
| MEDIUM | xmir_base/ubireader/ubifs/defines.py | 9 | # -------------------------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | activate_boot.py | 155 | if ( flag_try_sys1_failed > 1 || flag_try_sys2_failed > 1 || flag_ota_reboot > 1 || flag_last_success > 1 ) | STRING |
| HIGH | activate_boot.py | 158 | if ( flag_try_sys1_failed == 1 && flag_try_sys2_failed == 1 ) | STRING |
| HIGH | install_ssh.py | 65 | grep -v "/ssh_patch.sh" $FILE_CRON > $FILE_CRON.new || echo "" > $FILE_CRON.new | CODE |
| HIGH | unlock_features.py | 264 | grep -v "/unlockf_patch.sh" $FILE_CRON > $FILE_CRON.new || echo "" > $FILE_CRON.new | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | connect4.py | 70 | # Create an SSL context object and configure it for the client | COMMENT |
| MEDIUM | connect4.py | 75 | # Create a TCP socket object | COMMENT |
| MEDIUM | xmir_base/ubireader/ubifs/defines.py | 11 | # This file is part of UBIFS. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | gateway.py | 380 | CODE | |
| LOW | connect4.py | 87 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | xmir_base/fdt/__init__.py | 26 | __all__ = [ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | xmir_base/telnetlib/telnetlib.py | 418 | def set_option_negotiation_callback(self, callback): | CODE |