Skip to content

Commit 56c1460

Browse files
authored
Merge pull request #233 from nextcloud/fix/deps-and-ci
fix: close commonmark and bundled JS advisories, repair integration CI
2 parents 1d61093 + 927aa4f commit 56c1460

7 files changed

Lines changed: 87 additions & 24 deletions

File tree

‎.github/workflows/integration.yml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,16 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
php-versions: ['8.2']
39-
databases: ['sqlite']
40-
server-versions: ['master', 'stable33']
38+
# Pair each server branch with a PHP version it actually supports. A plain
39+
# cross-product put PHP 8.2 against master, which requires 8.3 or newer, so
40+
# `occ maintenance:install` aborted before any test ran.
41+
include:
42+
- php-versions: '8.2'
43+
databases: 'sqlite'
44+
server-versions: 'stable33'
45+
- php-versions: '8.3'
46+
databases: 'sqlite'
47+
server-versions: 'master'
4148

4249
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}
4350

‎CHANGELOG.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ All notable changes to this project will be documented in this file.
88
The format is based on [Keep a Changelog](http://keepachangelog.com/)
99
and this project adheres to [Semantic Versioning](http://semver.org/).
1010

11+
## 3.2.8
12+
13+
### Fixed
14+
15+
- Update `league/commonmark` to 2.10.0, closing four high-severity denial-of-service
16+
advisories and an `AttributesExtension` unsafe-link filter bypass on the converter
17+
used to render issue and pull request bodies.
18+
- Update bundled JavaScript dependencies to close the remaining high-severity
19+
advisories (dompurify, js-yaml, nanoid).
20+
1121
## 3.2.7 - 2026-08-18
1222

1323
### Added

‎composer.lock‎

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package-lock.json‎

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
"node": "^24.0.0",
3737
"npm": "^11.3.0"
3838
},
39+
"overrides": {
40+
"dompurify": "^3.4.13",
41+
"js-yaml": "^4.3.1",
42+
"nanoid": "^3.3.18"
43+
},
3944
"dependencies": {
4045
"@alchemyalcove/rgb-to-hsl": "^1.0.5",
4146
"@highlightjs/vue-plugin": "^2.1.0",

‎tests/integration/GitHubHtml.php‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,27 @@ public static function findTwoFactorCheckupDelayForm(DOMXPath $selector): ?DOMEl
6464
]);
6565
}
6666

67+
/**
68+
* Whether this is GitHub's "Verify your two-factor authentication (2FA) settings"
69+
* checkup page, regardless of whether a dismissable delay form is present.
70+
*
71+
* The page is sometimes served with only a client-rendered
72+
* `/settings/two_factor_checkup` form carrying no named inputs, which cannot be
73+
* posted back. Detecting it separately from the delay form lets the caller report
74+
* that specifically instead of failing with a generic "no form found".
75+
*/
76+
public static function isTwoFactorCheckupPage(DOMXPath $selector, string $url = ''): bool {
77+
if (str_contains($url, 'two_factor_checkup')) {
78+
return true;
79+
}
80+
81+
$checkupForm = self::findForm($selector, [
82+
'//form[contains(@action, "two_factor_checkup")]',
83+
]);
84+
85+
return $checkupForm !== null;
86+
}
87+
6788
public static function findTotpAlternativeUrl(DOMXPath $selector): ?string {
6889
$linkSelectors = [
6990
'//a[contains(@href, "two-factor/app")]',

‎tests/integration/GithubOauthIntegrationTest.php‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,18 @@ private function interpretAuthenticatedResponse(string $body, string $finalUrl,
249249
];
250250
}
251251

252+
// The same checkup, but served with only a client-rendered form carrying no
253+
// named inputs. There is nothing to post back, so it cannot be dismissed from
254+
// here; report it distinctly so the caller can skip rather than fail on what is
255+
// account state rather than a regression.
256+
if (GitHubHtml::isTwoFactorCheckupPage($selector, $finalUrl)) {
257+
return [
258+
'status' => 'two_factor_checkup_blocked',
259+
'checkup_url' => $finalUrl,
260+
'body' => $body,
261+
];
262+
}
263+
252264
$isTwoFactorPage = GitHubHtml::findTwoFactorForm($selector) !== null
253265
|| str_contains($finalUrl, 'two-factor')
254266
|| str_contains($title, 'Two-factor authentication');
@@ -506,6 +518,14 @@ public function testOAuthLogin(): array {
506518
$loginResult = $this->dismissTwoFactorCheckup($loginResult['body'], $loginResult['checkup_url'] ?? $authorizeUrl);
507519
}
508520

521+
if ($loginResult['status'] === 'two_factor_checkup_blocked') {
522+
$this->markTestSkipped(
523+
'GitHub is showing the two-factor authentication checkup page for the CI account at '
524+
. ($loginResult['checkup_url'] ?? $authorizeUrl) . ' and served no dismissable delay form. '
525+
. 'Sign in as the CI account once and complete or postpone the checkup to re-enable this test.'
526+
);
527+
}
528+
509529
if ($loginResult['status'] === 'invalid_credentials') {
510530
$this->fail('Invalid GitHub credentials');
511531
}

0 commit comments

Comments
 (0)