Skip to content

[DO NOT MERGE] test: verify every CodeQL analysis path - #760

Closed
kieran-osgood-shopify wants to merge 2 commits into
codeqlfrom
codeql-canaries
Closed

kieran-osgood-shopify wants to merge 2 commits into
codeqlfrom
codeql-canaries

Conversation

@kieran-osgood-shopify

@kieran-osgood-shopify kieran-osgood-shopify commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

What changes are you making?

Caution

DO NOT MERGE. This disposable third stack layer intentionally introduces security vulnerabilities and will be removed after verification.

This verifies that the custom CodeQL workflow extracts and reports findings from every newly configured analysis path: the core Swift and Android SDKs, both React Native native wrappers, JavaScript, TypeScript, and Ruby.

Analysis Canary Expected query
Analyze (swift) platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift swift/unsafe-webview-fetch
Analyze (react-native-ios) platforms/react-native/modules/@shopify/checkout-kit-react-native/ios/CodeQLCanary.swift swift/unsafe-webview-fetch
Analyze (android) platforms/android/lib/src/main/java/com/shopify/checkoutkit/CodeQLCanary.kt java/android/cleartext-storage-shared-prefs
Analyze (react-native-android) platforms/react-native/modules/@shopify/checkout-kit-react-native/android/src/main/java/com/shopify/reactnative/checkoutkit/CodeQLCanary.java java/insecure-trustmanager
Analyze (javascript-typescript) codeql-canary/javascript-command-injection.js js/command-line-injection
Analyze (javascript-typescript) codeql-canary/typescript-command-injection.ts js/command-line-injection
Analyze (ruby) codeql-canary/ruby-command-injection.rb rb/command-line-injection

After the inline findings and analysis categories are verified, return this PR to draft or close it and delete codeql-canaries.

How to test

GIVEN this disposable PR is marked ready for review and contains the seven intentional canaries listed above

WHEN the custom CodeQL workflow completes all six affected analysis jobs

THEN each canary should have an inline finding with the expected query ID, both React Native platform categories should report independently from their core native categories, and the separate GitHub Advanced Security CodeQL check should fail because the findings are present


Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/swift/README.md and/or platforms/android/README.md)

Releasing a new Swift version?
  • I have bumped the version in ShopifyCheckoutKit.podspec
  • I have bumped the version in platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Embedded Checkout Protocol version?
  • I have bumped embeddedCheckoutProtocolAndroid in platforms/android/gradle/libs.versions.toml
  • I have updated protocol/languages/kotlin/embedded-checkout-protocol/api/embedded-checkout-protocol.api if the public API changed
Releasing a new Android version?
  • I have bumped checkoutKitAndroid in platforms/android/gradle/libs.versions.toml
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

Tip

See the Contributing documentation for the full release process per platform.

@kieran-osgood-shopify
kieran-osgood-shopify added this pull request to stack #759 September 10, 2026 11:07
@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Sep 10, 2026
@kieran-osgood-shopify
kieran-osgood-shopify marked this pull request as ready for review September 10, 2026 11:08
@kieran-osgood-shopify
kieran-osgood-shopify requested a review from a team as a code owner September 10, 2026 11:08
@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 91%
90.97% (363/399) 87.29% (213/244) 100% (92/92)

Comment on lines +1 to +6
class CodeQLCanaryController < ActionController::Base
def create
file = params[:file]
system("cat #{file}")
end
end
class CodeQLCanaryController < ActionController::Base
def create
file = params[:file]
system("cat #{file}")
http
.createServer((request, response) => {
const command = url.parse(request.url, true).query.command;
childProcess.spawn(command);
.createServer((request, response) => {
const command = url.parse(request.url ?? "", true).query.command;
if (typeof command === "string") {
childProcess.spawn(command);
@github-actions

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
React Native npm tarball 108.6 KiB 109.0 KiB +439 B
Android release AAR 366.4 KiB 367.4 KiB +1.0 KiB
React Native file breakdown
File Base Head Delta
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.ts 85.4 KiB 85.4 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.d.ts 53.0 KiB 53.0 KiB 0 B
android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitModule.java 16.2 KiB 16.2 KiB 0 B
ios/ShopifyCheckoutKit.swift 16.1 KiB 16.1 KiB 0 B
ios/AcceleratedCheckoutButtons.swift 14.1 KiB 14.1 KiB 0 B
src/components/AcceleratedCheckoutButtons.tsx 13.0 KiB 13.0 KiB 0 B
src/index.ts 12.7 KiB 12.7 KiB 0 B
lib/commonjs/index.js 12.4 KiB 12.4 KiB 0 B
lib/commonjs/components/AcceleratedCheckoutButtons.js 11.4 KiB 11.4 KiB 0 B
src/index.d.ts 11.3 KiB 11.3 KiB 0 B
lib/commonjs/components/AcceleratedCheckoutButtons.js.map 10.4 KiB 10.4 KiB 0 B
lib/module/index.js 10.4 KiB 10.4 KiB 0 B
lib/module/components/AcceleratedCheckoutButtons.js 10.2 KiB 10.2 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.ts 9.5 KiB 9.5 KiB 0 B
lib/module/components/AcceleratedCheckoutButtons.js.map 9.1 KiB 9.1 KiB 0 B
lib/module/index.js.map 8.1 KiB 8.1 KiB 0 B
src/present-dispatcher.ts 8.0 KiB 8.0 KiB 0 B
lib/commonjs/index.js.map 7.9 KiB 7.9 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.d.ts 7.6 KiB 7.6 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolRenameMap.ts 7.2 KiB 7.2 KiB 0 B
…and 119 smaller files
Android file breakdown
File Base Head Delta
classes.jar 390.3 KiB 391.4 KiB +1.0 KiB
res/layout/checkout_view_content.xml 2.6 KiB 2.6 KiB 0 B
res/layout/checkout_sheet_content.xml 2.0 KiB 2.0 KiB 0 B
res/values/values.xml 1.3 KiB 1.3 KiB 0 B
R.txt 1.2 KiB 1.2 KiB 0 B
AndroidManifest.xml 922 B 922 B 0 B
proguard.txt 798 B 798 B 0 B
res/drawable/close.xml 431 B 431 B 0 B
res/menu/checkout_menu.xml 354 B 354 B 0 B
META-INF/com/android/build/gradle/aar-metadata.properties 157 B 157 B 0 B

Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report.

Comment on lines +10 to +11
.putString("password", password)
.apply()
static SSLContext insecureContext() throws NoSuchAlgorithmException, KeyManagementException {
SSLContext context = SSLContext.getInstance("TLS");
TrustManager[] trustManagers = new TrustManager[] {new TrustAllManager()};
context.init(null, trustManagers, null);
enum ReactNativeCodeQLCanary {
static func loadRemoteHTML(in webView: WKWebView) throws {
let remoteHTML = try String(contentsOf: URL(string: "https://example.com")!)
webView.loadHTMLString(remoteHTML, baseURL: nil)
@bitrise

bitrise Bot commented Sep 10, 2026

Copy link
Copy Markdown

Install this build

Open Tophat, select your target device, then click Install. Links open on the Mac running Tophat.

SDK Install
React Native Install with Tophat
Swift Install with Tophat
Kotlin Install with Tophat

Checkout Kit E2E results

Status Tags Target Platform OS version tag Device
launch, checkout-presentation, checkout-completion, buyer-identity react-native ios latest iPhone 15
iOS 27 Beta
launch, checkout-presentation, checkout-completion, buyer-identity react-native android latest Google Pixel 9
Android 17.0
launch, checkout-presentation, checkout-completion, buyer-identity, preload kotlin android latest Google Pixel 9
Android 17.0
launch, checkout-presentation, checkout-completion, buyer-identity, preload swift ios latest iPhone 15
iOS 27 Beta

@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the codeql-canaries branch 3 times, most recently from c275a17 to 0a356ce Compare September 10, 2026 13:23
This disposable commit adds intentional security findings for the core Swift and Android SDKs, both React Native native wrappers, JavaScript, TypeScript, and Ruby.
enum CodeQLCanary {
static func loadRemoteHTML(in webView: WKWebView) throws {
let remoteHTML = try String(contentsOf: URL(string: "https://example.com")!)
webView.loadHTMLString(remoteHTML, baseURL: nil)
@kieran-osgood-shopify

Copy link
Copy Markdown
Contributor Author

Verification complete

Run 34498749383 completed all seven CodeQL analysis jobs successfully.

The core Swift category /language:swift/platform:swift produced the expected swift/unsafe-webview-fetch result in the production package build path:

  • Code scanning alert #10
  • platforms/swift/Sources/ShopifyCheckoutKit/CheckoutWebView.swift:1142
  • Tainted data is used in a WebView fetch without restricting the base URL.

This confirms the focused swiftc -typecheck passes restore executable-body CFG and data-flow extraction for the package dependency modules. The remaining six intentional canaries were also detected in their expected categories.

This PR contains intentional vulnerabilities and must not merge. Closing it now that verification is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants