René's URL Explorer Experiment


Title: cpp: Add 'cpp/mmio-unsanitized-memcpy' query by Tito0015 · Pull Request #22438 · github/codeql · GitHub

Open Graph Title: cpp: Add 'cpp/mmio-unsanitized-memcpy' query by Tito0015 · Pull Request #22438 · github/codeql

X Title: cpp: Add 'cpp/mmio-unsanitized-memcpy' query by Tito0015 · Pull Request #22438 · github/codeql

Description: Summary Adds a new security query cpp/mmio-unsanitized-memcpy targeting unsanitized memory copy operations (memcpy, memmove, strncpy) where size parameters derive directly from hardware registers (MMIO/DMA) without relational bounds checks. Motivation & Domain Context Standard buffer overflow queries (UnboundedWrite.ql, OverrunWrite.ql) model user-space strings and generic memory ops, but do not model volatile register macro reads (READ_REG, GET_MMIO) commonly found in microcontroller drivers, RTOS kernels, and embedded hardware stacks. This query fills a gap for embedded C/C++ static analysis. Query Design & Architecture Taint Engine: Modern DataFlow::ConfigSig with TaintTracking::Global. Sources: Volatile variables, volatile struct fields, volatile pointer dereferences, and MMIO macros (READ_REG, GET_MMIO, REG_READ, DMA_READ). Sinks: Parameter index 2 (size/count) of memcpy, memmove, strncpy, wmemcpy, wmemmove. Barriers: Public IRGuards via DataFlow::BarrierGuard to recognize if (len <= MAX) conditions and prevent false positives. lessThanOrEqual uses the public Operand + getConvertedResultExpression() pattern. Public API Compliance: Uses only public APIs (cpp, TaintTracking, IRGuards). Zero internal. / DataFlowImplCommon dependencies. Verification & Test Results Test Command: codeql test run cpp/ql/test/query-tests/Security/CWE/CWE-120/MmioUnsanitizedMemcpy/ Result: All 1 tests passed (3 positive alerts, 3 false-positive barrier test cases clean). Documentation: codeql generate query-help passed DTD verification and rendered clean markdown. Suite Integration: Explicit include of cpp/mmio-unsanitized-memcpy in cpp-security-extended.qls. Checklist Query metadata follows upstream style guidelines (@kind path-problem, @precision medium, @security-severity 8.6). .qhelp file provided with valid DTD structure and Bad/Good examples. Test directory contains .qlref, test.c, and verified .expected output. Query added to appropriate .qls suite. No internal. module imports used.

Open Graph Description: Summary Adds a new security query cpp/mmio-unsanitized-memcpy targeting unsanitized memory copy operations (memcpy, memmove, strncpy) where size parameters derive directly from hardware registers (...

X Description: Summary Adds a new security query cpp/mmio-unsanitized-memcpy targeting unsanitized memory copy operations (memcpy, memmove, strncpy) where size parameters derive directly from hardware registers (...

Opengraph URL: https://github.com/github/codeql/pull/22438

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:508ce493-78f9-61a1-d3a1-13dd9caf556e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBABC:3E15AA:A52C0F:E3932F:6AF98D1E
html-safe-nonce4afa3915c5ee8bfc5ca708a63d541c8ee4fa15f04ce1887a5581f2a07b4316d7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUJDOjNFMTVBQTpBNTJDMEY6RTM5MzJGOjZBRjk4RDFFIiwidmlzaXRvcl9pZCI6IjU5NTYzNTA5ODcyMDI0Mjk3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8c42b61dfeca2cbf35f8fdffda6cf9329f22c21695f79f5a9781d70797dbf999
hovercard-subject-tagpull_request:4372611278
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/github/codeql/pull/22438/files
twitter:imagehttps://avatars.githubusercontent.com/u/74791610?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/74791610?s=400&v=4
og:image:altSummary Adds a new security query cpp/mmio-unsanitized-memcpy targeting unsanitized memory copy operations (memcpy, memmove, strncpy) where size parameters derive directly from hardware registers (...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/codeql git https://github.com/github/codeql.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id143040428
octolytics-dimension-repository_nwogithub/codeql
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id143040428
octolytics-dimension-repository_network_root_nwogithub/codeql
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release072e34035c13c31543fba9f025cbbbda4210dae4
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/codeql/pull/22438/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fpull%2F22438%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fpull%2F22438%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=github%2Fcodeql
Reloadhttps://github.com/github/codeql/pull/22438/files
Reloadhttps://github.com/github/codeql/pull/22438/files
Reloadhttps://github.com/github/codeql/pull/22438/files
githubhttps://github.com/github
codeqlhttps://github.com/github/codeql
Codehttps://github.com/github/codeql
Issues1k (1k)https://github.com/github/codeql/issues
Pull requests516 (516)https://github.com/github/codeql/pulls
Discussionshttps://github.com/github/codeql/discussions
Actionshttps://github.com/github/codeql/actions
Projectshttps://github.com/github/codeql/projects
Security and qualityhttps://github.com/github/codeql/security
Insightshttps://github.com/github/codeql/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fcodeql%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fcodeql%2Fissues%2Fnew%2Fchoose
geoffw0https://github.com/geoffw0
github:mainhttps://github.com/github/codeql/tree/main
Tito0015:feature/cpp-mmio-unsanitized-memcpyhttps://github.com/Tito0015/codeql/tree/feature/cpp-mmio-unsanitized-memcpy
Conversation 21 https://github.com/github/codeql/pull/22438
Commits 7 https://github.com/github/codeql/pull/22438/commits
Checks 8 https://github.com/github/codeql/pull/22438/checks
Findings https://github.com/github/codeql/pull/22438/findings
Files changed https://github.com/github/codeql/pull/22438/files
Please reload this pagehttps://github.com/github/codeql/pull/22438/files
cpp: Add 'cpp/mmio-unsanitized-memcpy' query https://github.com/github/codeql/pull/22438/files#top
Show all changes 7 commits https://github.com/github/codeql/pull/22438/files
b681bc4 cpp: Add 'cpp/mmio-unsanitized-memcpy' query Tito0015 Aug 27, 2026 https://github.com/github/codeql/pull/22438/commits/b681bc4eb222b6fbd6a157b45ae0121588654bde
e20ec33 cpp: Add change note for mmio-unsanitized-memcpy query Tito0015 Aug 31, 2026 https://github.com/github/codeql/pull/22438/commits/e20ec33e48cf9034a78aba1e2395399a7be33ba4
30544e8 cpp: Move mmio-unsanitized-memcpy to experimental Tito0015 Sep 2, 2026 https://github.com/github/codeql/pull/22438/commits/30544e867ba88a54dd32746cb95a13e22ec51048
56c5f3a cpp: Drop experimental query id prefix and change note Tito0015 Sep 3, 2026 https://github.com/github/codeql/pull/22438/commits/56c5f3ab14b129ed32b604679b3ba900834436ef
5d6e2d4 cpp: fix alert location and update integration test expectations Tito0015 Sep 4, 2026 https://github.com/github/codeql/pull/22438/commits/5d6e2d421c665353cbf2a36fd66174075ce90871
ff2416b cpp: remove non-ASCII character in test file Tito0015 Sep 4, 2026 https://github.com/github/codeql/pull/22438/commits/ff2416b0bf8228ff4eb656f24b64f05fc7c697d1
e41e090 cpp: address review nits on qhelp references and test header Tito0015 Sep 17, 2026 https://github.com/github/codeql/pull/22438/commits/e41e0908f44029cb250c22b04d259fab442157a9
Clear filters https://github.com/github/codeql/pull/22438/files
Please reload this pagehttps://github.com/github/codeql/pull/22438/files
Please reload this pagehttps://github.com/github/codeql/pull/22438/files
not_included_in_qls.expected https://github.com/github/codeql/pull/22438/files#diff-450add471ec464798e90505666bf76c23df55d3b6c4188eb5a5c4aca29927794
MmioUnsanitizedMemcpy.qhelp https://github.com/github/codeql/pull/22438/files#diff-d3815c689447d6026c9c0e6efc590974c5b500781ad0140060f6a9ea73283bf7
MmioUnsanitizedMemcpy.ql https://github.com/github/codeql/pull/22438/files#diff-a41119c7e9c101c455208971b321685d556577363f4ec48d2948863e57409951
MmioUnsanitizedMemcpyBad.c https://github.com/github/codeql/pull/22438/files#diff-2477f1857c8ad1a9069992bd79e6d952015757ecdc8ea29a67f910fec68669a9
MmioUnsanitizedMemcpyGood.c https://github.com/github/codeql/pull/22438/files#diff-1c1b70debf2b108aa04bb05e0a93bba4f66b4b519077b1751db7c8af8bc089d1
MmioUnsanitizedMemcpy.expected https://github.com/github/codeql/pull/22438/files#diff-a14f763a666f30b57e27de66e6566d4480af961e24b6cd1552b649b24b660ad1
MmioUnsanitizedMemcpy.qlref https://github.com/github/codeql/pull/22438/files#diff-001975fecdecc21b332e17cf8366eb25139c71da7eaea5b3913d94b8fd44f917
test.c https://github.com/github/codeql/pull/22438/files#diff-f40c0a3a4db0bb57a5316004539b4ee01559af7e4eb39b16cdcf2bc3ccdb12aa
https://github.com/github/codeql/blob/main/CODEOWNERS#L6
cpp/ql/integration-tests/query-suite/not_included_in_qls.expectedhttps://github.com/github/codeql/pull/22438/files#diff-450add471ec464798e90505666bf76c23df55d3b6c4188eb5a5c4aca29927794
View file https://github.com/Tito0015/codeql/blob/e41e0908f44029cb250c22b04d259fab442157a9/cpp/ql/integration-tests/query-suite/not_included_in_qls.expected
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/22438/{{ revealButtonHref }}
https://github.com/github/codeql/pull/22438/files#diff-450add471ec464798e90505666bf76c23df55d3b6c4188eb5a5c4aca29927794
https://github.com/github/codeql/pull/22438/files#diff-450add471ec464798e90505666bf76c23df55d3b6c4188eb5a5c4aca29927794
https://github.com/github/codeql/blob/main/CODEOWNERS#L6
cpp/ql/src/experimental/Security/CWE/CWE-120/MmioUnsanitizedMemcpy.qhelphttps://github.com/github/codeql/pull/22438/files#diff-d3815c689447d6026c9c0e6efc590974c5b500781ad0140060f6a9ea73283bf7
View file https://github.com/Tito0015/codeql/blob/e41e0908f44029cb250c22b04d259fab442157a9/cpp/ql/src/experimental/Security/CWE/CWE-120/MmioUnsanitizedMemcpy.qhelp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/22438/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L6
cpp/ql/src/experimental/Security/CWE/CWE-120/MmioUnsanitizedMemcpy.qlhttps://github.com/github/codeql/pull/22438/files#diff-a41119c7e9c101c455208971b321685d556577363f4ec48d2948863e57409951
View file https://github.com/Tito0015/codeql/blob/e41e0908f44029cb250c22b04d259fab442157a9/cpp/ql/src/experimental/Security/CWE/CWE-120/MmioUnsanitizedMemcpy.ql
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/22438/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L6
cpp/ql/src/experimental/Security/CWE/CWE-120/MmioUnsanitizedMemcpyBad.chttps://github.com/github/codeql/pull/22438/files#diff-2477f1857c8ad1a9069992bd79e6d952015757ecdc8ea29a67f910fec68669a9
View file https://github.com/Tito0015/codeql/blob/e41e0908f44029cb250c22b04d259fab442157a9/cpp/ql/src/experimental/Security/CWE/CWE-120/MmioUnsanitizedMemcpyBad.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/22438/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L6
cpp/ql/src/experimental/Security/CWE/CWE-120/MmioUnsanitizedMemcpyGood.chttps://github.com/github/codeql/pull/22438/files#diff-1c1b70debf2b108aa04bb05e0a93bba4f66b4b519077b1751db7c8af8bc089d1
View file https://github.com/Tito0015/codeql/blob/e41e0908f44029cb250c22b04d259fab442157a9/cpp/ql/src/experimental/Security/CWE/CWE-120/MmioUnsanitizedMemcpyGood.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/22438/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L6
...tal/query-tests/Security/CWE/CWE-120/MmioUnsanitizedMemcpy/MmioUnsanitizedMemcpy.expectedhttps://github.com/github/codeql/pull/22438/files#diff-a14f763a666f30b57e27de66e6566d4480af961e24b6cd1552b649b24b660ad1
View file https://github.com/Tito0015/codeql/blob/e41e0908f44029cb250c22b04d259fab442157a9/cpp/ql/test/experimental/query-tests/Security/CWE/CWE-120/MmioUnsanitizedMemcpy/MmioUnsanitizedMemcpy.expected
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/22438/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L6
...mental/query-tests/Security/CWE/CWE-120/MmioUnsanitizedMemcpy/MmioUnsanitizedMemcpy.qlrefhttps://github.com/github/codeql/pull/22438/files#diff-001975fecdecc21b332e17cf8366eb25139c71da7eaea5b3913d94b8fd44f917
View file https://github.com/Tito0015/codeql/blob/e41e0908f44029cb250c22b04d259fab442157a9/cpp/ql/test/experimental/query-tests/Security/CWE/CWE-120/MmioUnsanitizedMemcpy/MmioUnsanitizedMemcpy.qlref
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/22438/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L6
cpp/ql/test/experimental/query-tests/Security/CWE/CWE-120/MmioUnsanitizedMemcpy/test.chttps://github.com/github/codeql/pull/22438/files#diff-f40c0a3a4db0bb57a5316004539b4ee01559af7e4eb39b16cdcf2bc3ccdb12aa
View file https://github.com/Tito0015/codeql/blob/e41e0908f44029cb250c22b04d259fab442157a9/cpp/ql/test/experimental/query-tests/Security/CWE/CWE-120/MmioUnsanitizedMemcpy/test.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/22438/{{ revealButtonHref }}
Please reload this pagehttps://github.com/github/codeql/pull/22438/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.