Skip to content

Project maintenance#486

Open
dnl-moh wants to merge 6 commits into
masterfrom
ci/update-xcode-16.2
Open

Project maintenance#486
dnl-moh wants to merge 6 commits into
masterfrom
ci/update-xcode-16.2

Conversation

@dnl-moh
Copy link
Copy Markdown
Member

@dnl-moh dnl-moh commented Apr 10, 2026

Summary

Updates CI to a modern Xcode version supported on CircleCI, and folds in pending dependency bumps.

Changes

  • CI: Xcode 15.4.016.4.0, resource class macos.m1.medium.gen1m4pro.medium (M1 no longer offered)
  • Ruby: .ruby-version 3.3.03.3.8 (matches what's pre-installed on the new CircleCI image)
  • BuildTools: SwiftFormat 0.54.30.61.0, SwiftLintPlugins 0.56.20.63.2, Package.resolved refreshed to match Package.swift
  • Gems: fastlane 2.229.02.232.2, cocoapods 1.16.2 (kept latest), addressable 2.8.82.9.0 (SNYK-RUBY-ADDRESSABLE-15924312) + transitive bumps
  • Xcode project: ENABLE_USER_SCRIPT_SANDBOXING = NO (Xcode 15+ default changed; required for swift run in build phases)
  • Build phase: SwiftFormat Run Script made non-fatal (was blocking CI for unclear reasons on Xcode 16.4; lint CI job remains the authoritative check)

Test fixes

Apple's Security framework (CVE-2024-23218, Jan 2024) added implicit rejection to SecKeyCreateDecryptedData for RSA PKCS#1 v1.5, mitigating the Marvin Attack (timing-based Bleichenbacher variant). Four tests were asserting the old "wrong key → throws" behavior; they now assert the actual security property (wrong key → does not recover the plaintext), which holds whether the API throws or returns pseudo-random bytes.

  • RSADecryptionTests.testDecryptingAliceSecretWithBobKey
  • RSADecryptionTests.testDecryptingBobSecretWithAliceKey
  • RSADecryptionTests.testCipherTextLengthExactlyRight
  • RSAKeyManagementModeTests.testEncryptsContentEncryptionKeyOnlyForProvidedKey

Library code (RSA.decrypt, RSAKeyEncryption.DecryptionMode) needed no changes — the JWE layer already implements RFC-3218 MMA mitigation.

Supersedes

Close these once merged:

Test plan

  • CircleCI prepare-build, lint, test jobs all pass
  • All 397 unit tests pass

@jenkins-airside
Copy link
Copy Markdown
Contributor

jenkins-airside commented Apr 10, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Migrate from deprecated M1 (macos.m1.medium.gen1) to M4 Pro
(m4pro.medium) and update Xcode from 15.4.0 to 16.4.0.

Update .ruby-version from 3.3.0 to 3.3.8 to match the version
pre-installed on the new CircleCI macOS image.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dnl-moh dnl-moh force-pushed the ci/update-xcode-16.2 branch from 2d122db to c40db99 Compare April 10, 2026 16:48
dnl-moh and others added 2 commits April 13, 2026 10:25
Apple's `SecKeyCreateDecryptedData` for RSA PKCS#1 v1.5 now uses
implicit rejection (RFC 8017) to mitigate Bleichenbacher padding-oracle
attacks: instead of failing on bad padding / wrong key, it returns
pseudo-random data so the caller cannot distinguish "wrong key" from
"right key, garbage plaintext."

The library already handles this at the JWE layer in
`RSAKeyEncryption.DecryptionMode` (substitutes a random CEK on failure
per RFC-3218), so no implementation change is needed. The four affected
tests, however, asserted the old "throws on wrong key" behavior. Rewrite
them to assert the security property that actually matters: decryption
with the wrong key must not recover the original plaintext (whether by
throwing or by returning data that doesn't equal the original).

Also drops the brittle `rsaDecryptionError` constant that hardcoded
an `OSStatus error -50` description string.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Package.resolved was stale: SwiftFormat pinned at 0.54.3 and
SwiftLintPlugins at 0.56.2, both below the constraints declared in
Package.swift. Xcode 15.4 / Swift 5.10 SPM tolerated this and
silently re-resolved during build phases, but Xcode 16.4 / Swift 6.1
fails the SwiftFormat run-script phase outright when the lock file
is out of sync.

Bump the SwiftFormat lower bound to match the current latest (0.61.0)
and re-resolve so Package.swift and Package.resolved agree.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dnl-moh dnl-moh changed the title chore(ci): update Xcode to 16.4.0 on M4 Pro resource class Project maintenance Apr 13, 2026
dnl-moh and others added 3 commits April 13, 2026 11:03
Xcode 15+ documents ENABLE_USER_SCRIPT_SANDBOXING as defaulting to YES
when not set, but our project (which predates that change) was passing
CI on Xcode 15.4 without the setting — the implicit behavior was
effectively NO for our framework target's script phases.

On Xcode 16.4, sandboxing is enforced more aggressively. The
'Lint using SwiftFormat' build phase runs \`swift run -c release
swiftformat\`, which writes build artifacts to BuildTools/.build/
(outside the sandbox-allowed paths). The script fails with a non-zero
exit code on the first build attempt, causing xcodebuild to report
overall failure even though all 397 tests subsequently pass.

Set ENABLE_USER_SCRIPT_SANDBOXING = NO at the project level (Debug
and Release) to restore the prior implicit behavior explicitly. Per
SwiftFormat's documented requirement for Xcode 15+.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bump Gemfile dependencies to latest:
- fastlane to 2.232.2 (with >= 2.229.1 security floor for addressable CVE)
- cocoapods to 1.16.2
- addressable to 2.9.0 (fixes SNYK-RUBY-ADDRESSABLE-15924312)
- plus all transitive bumps (aws-sdk-*, googleapis, activesupport, ...)

Supersedes PRs #466, #481, #482, #462, #463, #478, #479, #483, #485.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dnl-moh dnl-moh force-pushed the ci/update-xcode-16.2 branch from 4678dc4 to daf0153 Compare April 13, 2026 15:39
@sonarqubecloud
Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants