Skip to content

Redact GutenbergKit requests - #25854

Merged
crazytonyli merged 2 commits into
release/27.1from
bugfix/CMM-2191
Jul 30, 2026
Merged

Redact GutenbergKit requests#25854
crazytonyli merged 2 commits into
release/27.1from
bugfix/CMM-2191

Conversation

@crazytonyli

Copy link
Copy Markdown
Contributor

Description

Fixes https://linear.app/a8c/issue/CMM-2191.

The GBK requests went directly to the log store, without redacting sensitive headers.

@crazytonyli crazytonyli added this to the 27.1 ❄️ milestone Jul 30, 2026
@crazytonyli
crazytonyli requested a review from dcalhoun July 30, 2026 02:20
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ This PR is assigned to the milestone 27.1 ❄️. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot

wpmobilebot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number33546
VersionPR #25854
Bundle IDorg.wordpress.alpha
Commit33e1a66
Installation URL54patdh22ap5o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number33546
VersionPR #25854
Bundle IDcom.jetpack.alpha
Commit33e1a66
Installation URL42b3fuqd2602g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@dcalhoun dcalhoun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified sensitive headers are now redacted for GBK requests. Changes look good overall. I left a few suggestions for consideration.

_ viewController: GutenbergKit.EditorViewController,
didLogNetworkRequest request: GutenbergKit.RecordedNetworkRequest
) {
guard ExtensiveLogging.enabled, let url = URL(string: request.url) else {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was moving the ExtensiveLogging.enabled check into storeRequest intentional? Every WebView request in the editor now builds a URLRequest and HTTPURLResponse and UTF-8-encodes both bodies before storeRequest checks logger != nil and discards it — so logging-disabled sessions (most users) pay that cost on every request. Could the guard come back at the top here, with the one inside storeRequest kept as the safety net?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I have brought it back.

guard logger != nil else { return }

var request = request
request.allHTTPHeaderFields = Self.redactedHeaders(request.allHTTPHeaderFields)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be low-risk given we do not utilize the sensitiveQueryItems and sensitiveDataFields configuration options today, but noting that if they are added in the future, it seems this custom handler will not apply those. So, it's possible that future sensitive information is redacted from the NetworkLogger path, but remains present in this GBK-centric path.

Options might be a test asserting both paths redact equivalently to flag any future divergence, or exploring if storeRequest can read from Network.Configuration rather than Self.sensitiveHeaders so the divergence can't happen at all. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we put have sensitive data in URL. "read from Network.Configuration rather than Self.sensitiveHeaders" seems cleaner. I'll look into it later.

@crazytonyli
crazytonyli enabled auto-merge (squash) July 30, 2026 22:02
@crazytonyli
crazytonyli merged commit 1583fe4 into release/27.1 Jul 30, 2026
22 of 25 checks passed
@crazytonyli
crazytonyli deleted the bugfix/CMM-2191 branch July 30, 2026 22:15
crazytonyli added a commit that referenced this pull request Aug 1, 2026
* Redact GutenbergKit requests

* Add `ExtensiveLogging.enabled` check back
pull Bot pushed a commit to kliu/WordPress-iOS that referenced this pull request Aug 1, 2026
* Share Gallery media library handling between GutenbergKit editors (wordpress-mobile#25855)

* Allow Gutenberg media picker to use a blog

* Share Gallery media library handling between GutenbergKit editors

* Redact GutenbergKit requests (wordpress-mobile#25854)

* Redact GutenbergKit requests

* Add `ExtensiveLogging.enabled` check back

* Update app translations – `Localizable.strings`

* Update plural translations from GlotPress

* Update WordPress metadata translations

* Update Jetpack metadata translations

* Bump version number

---------

Co-authored-by: Tony Li <tony.li@automattic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants