René's URL Explorer Experiment


Title: Read-modify-write through the MCP permanently destroys stored issue and PR body content · Issue #3165 · github/github-mcp-server · GitHub

Open Graph Title: Read-modify-write through the MCP permanently destroys stored issue and PR body content · Issue #3165 · github/github-mcp-server

X Title: Read-modify-write through the MCP permanently destroys stored issue and PR body content · Issue #3165 · github/github-mcp-server

Description: Summary Body sanitization is lossy and applied on read, so a client's in-memory copy of a body is already damaged before it edits anything. Editing a body means sending the whole body back, so an ordinary read-modify-write cycle writes t...

Open Graph Description: Summary Body sanitization is lossy and applied on read, so a client's in-memory copy of a body is already damaged before it edits anything. Editing a body means sending the whole body back, so an o...

X Description: Summary Body sanitization is lossy and applied on read, so a client's in-memory copy of a body is already damaged before it edits anything. Editing a body means sending the whole body back, so ...

Opengraph URL: https://github.com/github/github-mcp-server/issues/3165

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Read-modify-write through the MCP permanently destroys stored issue and PR body content","articleBody":"### Summary\n\nBody sanitization is lossy and applied on read, so a client's in-memory copy of a body is already damaged before it edits anything. Editing a body means sending the whole body back, so an ordinary read-modify-write cycle writes the damage back and the sanitizer's deletions become permanent in GitHub's stored data.\n\nThe loop needs no misbehaviour:\n\n1. A client reads an issue or PR body through a sanitizing read path.\n2. It makes an unrelated edit — ticking a checklist box, appending a status line.\n3. It writes the whole body back.\n\nEverything the sanitizer removed in step 1 is now gone from the stored issue. This turns a response-fidelity problem into repository data loss.\n\n### Reproduction\n\nVerified 2026-08-26. `pkg/sanitize/sanitize.go` at `main` ([`a00dc319`](https://github.com/github/github-mcp-server/commit/a00dc319edcb5f8a10f118b1dad649c94928aac4)) produces this behaviour.\n\nCreate an issue **via REST, not the MCP**, with this body:\n\n```markdown\n## Checklist\n\n- [ ] step one\n- [ ] step two\n\n## Probe 1\n\nSENTINEL-1-BEFORE. The retry threshold is \u003cn> by default. SENTINEL-1-AFTER.\n\n## Probe 2\n\nSENTINEL-2-BEFORE. Returns Promise\u003cstring> on success. SENTINEL-2-AFTER.\n\n## Probe 3\n\nSENTINEL-3-BEFORE. The style probe: `\u003cstyle>`. SENTINEL-3-AFTER-SHOULD-SURVIVE.\n```\n\nThen:\n\n1. `GET /repos/{owner}/{repo}/issues/{n}` — body intact, **492 bytes**.\n2. `issue_read` (`get`) — `\u003cn>` and `\u003cstring>` are gone, and the body ends mid-sentence at the `\u003cstyle>` probe, with `SENTINEL-3-AFTER-SHOULD-SURVIVE` absent.\n3. `issue_write` (`update`), sending back exactly what step 2 returned, with `- [ ] step one` changed to `- [x] step one`. One character of intent.\n4. `GET` again — **438 bytes.**\n\nThe stored body, diffed against the baseline:\n\n```diff\n-- [ ] step one\n+- [x] step one\n\n-SENTINEL-1-BEFORE. The retry threshold is \u003cn> by default. SENTINEL-1-AFTER.\n+SENTINEL-1-BEFORE. The retry threshold is  by default. SENTINEL-1-AFTER.\n\n-SENTINEL-2-BEFORE. Returns Promise\u003cstring> on success. SENTINEL-2-AFTER.\n+SENTINEL-2-BEFORE. Returns Promise on success. SENTINEL-2-AFTER.\n\n-SENTINEL-3-BEFORE. The style probe: `\u003cstyle>`. SENTINEL-3-AFTER-SHOULD-SURVIVE.\n+SENTINEL-3-BEFORE. The style probe: `\n```\n\nOne intended change; 54 bytes destroyed, including the entire tail of the body after `\u003cstyle>`.\n\n### Why this is filed separately from [#2202](https://github.com/github/github-mcp-server/issues/2202)\n\n[#2202](https://github.com/github/github-mcp-server/issues/2202) reports the read-side symptom, framed as angle-bracket loss inside code blocks. The fix is the same — stop mangling bodies — but the severity is not. A client that only reads gets a degraded response; a client that reads, edits and writes back destroys stored content, and the currently merged behaviour makes every such client destructive by default.\n\nTwo properties make it hard to catch:\n\n- **No marker.** Deletions often splice the surrounding text together and read grammatically; truncation simply ends. A client comparing its intended edit against what it sent sees nothing wrong.\n- **The client is behaving correctly.** Sending back the body it was given is the documented way to edit an issue.\n\n### The worst input: skip-content elements truncate everything after them\n\nbluemonday keeps a set of elements whose *content* is discarded along with the tag — `frame, frameset, iframe, noembed, noframes, noscript, nostyle, object, script, style, title` (`policy.go:979-990` in v1.0.27). The skip flag clears only on the matching end tag, so an opening tag with no closing tag — routine in a markdown body — drops everything to end-of-body.\n\nMembership is a policy list, not an HTML category, and predicting from the category gets it backwards in both directions: `iframe` and `object` truncate without being raw-text elements, while `textarea` does not truncate despite being one. [@franklinjavier set this out in detail on #2202](https://github.com/github/github-mcp-server/issues/2202#issuecomment-5429937295).\n\nIndependent public reproduction with sentinels: [flungo/claude-plugins#55](https://github.com/flungo/claude-plugins/pull/55) and its test comments B, C and D — one of which cut itself off at its own header.\n\nCombined with the write loop, a single backticked `\u003cstyle>` in a body means one checkbox tick discards everything below it, permanently.\n\n### Scope\n\nBackticks and code fences offer no protection: the pass runs on the raw string before any markdown parsing. [@ericknavarro's census on #2202](https://github.com/github/github-mcp-server/issues/2202#issuecomment-5149562849) measured 177 bodies with confirmed mid-body loss out of 600 recent items in one repository — worst case 2,755 characters deleted from an 8,360-character body — and found the majority of the damage in prose rather than code.\n\nCoverage widened considerably in [`56bfeec0`](https://github.com/github/github-mcp-server/commit/56bfeec0a9bd0ad6a6d88a047541d9e9acad8101) (2026-08-19), which centralized `sanitize.Sanitize` into the shared `convertToMinimal*` converters — so comment bodies, review bodies, review comment bodies, releases and commit messages are now affected where previously they were not. `minimal_types.go` currently reads `Body: sanitize.Sanitize(comment.GetBody())`.\n\n### Suggested fix\n\n[@ericknavarro](https://github.com/github/github-mcp-server/issues/2202#issuecomment-5149562849) proposed the approach on #2202 on 2026-08-01: skip `FilterHTMLTags` for body fields entirely.\n\n[#3035](https://github.com/github/github-mcp-server/pull/3035) implements it, as a `FilterBody` that keeps the injection defences which matter for bodies — invisible characters, BiDi overrides, hidden code-fence info strings — and drops only the HTML pass, reserving full `Sanitize` for titles. It has had reviewer engagement, and predates the 2026-08-19 refactor of `Sanitize`, so it needs updating against current `main`.\n\nIts three sibling PRs — [#3039](https://github.com/github/github-mcp-server/pull/3039), [#3040](https://github.com/github/github-mcp-server/pull/3040), [#3043](https://github.com/github/github-mcp-server/pull/3043) — still apply full `sanitize.Sanitize` to bodies, and #3043 applies it to gist **file content**. Merging those as written would extend this problem rather than contain it.\n\nIf the HTML pass must stay for bodies, entity-escaping an unrecognized `\u003c` rather than deleting the span would at least preserve meaning.\n\n### Related\n\n- [#2202](https://github.com/github/github-mcp-server/issues/2202) — primary read-side report, open since 2026-03-12\n- [#3106](https://github.com/github/github-mcp-server/issues/3106) — the coverage-consistency issue, which asked for \"a content-safe strategy for source code and file contents\"\n- Fix attempts: [#3035](https://github.com/github/github-mcp-server/pull/3035) (open), [#2408](https://github.com/github/github-mcp-server/pull/2408) (open, code regions only), [#2633](https://github.com/github/github-mcp-server/pull/2633) (closed), [#2308](https://github.com/github/github-mcp-server/pull/2308) (closed)\n\n🤖 Investigated and drafted by Claude Code (Claude Opus 5)","author":{"url":"https://github.com/arolling-sa","@type":"Person","name":"arolling-sa"},"datePublished":"2026-08-26T19:56:03Z","url":"https://github.com/github/github-mcp-server/issues/3165"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:2293efe7-dd9c-f81b-08a7-bb4062ee5187
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE394:2D919D:1EA3449:286A286:6B068E20
html-safe-noncebd2030360459998dfcac9912304803278372256c20f05ec6226395adf5e8648a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzk0OjJEOTE5RDoxRUEzNDQ5OjI4NkEyODY6NkIwNjhFMjAiLCJ2aXNpdG9yX2lkIjoiMzIwNDU5MDMyMjQyODg0MTUwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac4f72a960543452b158e64cd20e8c94ca0741d2aee4be2d202794856e99e2c5f2
hovercard-subject-tagissue:5260928487
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/github-mcp-server/3165/issue_layout
twitter:imagehttps://opengraph.githubassets.com/30d78a60b9e9968544e260b6b7a63e7e2ab8968fab29b5dab49f25236e560c36/github/github-mcp-server/issues/3165
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/30d78a60b9e9968544e260b6b7a63e7e2ab8968fab29b5dab49f25236e560c36/github/github-mcp-server/issues/3165
og:image:altSummary Body sanitization is lossy and applied on read, so a client's in-memory copy of a body is already damaged before it edits anything. Editing a body means sending the whole body back, so an o...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamearolling-sa
hostnamegithub.com
expected-hostnamegithub.com
None4462ff7ebfd3d551f202659f2423dae617b6849d23b1df6465dc504ef497d14a
turbo-cache-controlno-preview
go-importgithub.com/github/github-mcp-server git https://github.com/github/github-mcp-server.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id942771284
octolytics-dimension-repository_nwogithub/github-mcp-server
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id942771284
octolytics-dimension-repository_network_root_nwogithub/github-mcp-server
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release6d3909414814ff86ce7da4c51a0f4918a13fb41b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/github/github-mcp-server/issues/3165#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fgithub-mcp-server%2Fissues%2F3165
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%2Fgithub-mcp-server%2Fissues%2F3165
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=github%2Fgithub-mcp-server
Reloadhttps://github.com/github/github-mcp-server/issues/3165
Reloadhttps://github.com/github/github-mcp-server/issues/3165
Reloadhttps://github.com/github/github-mcp-server/issues/3165
githubhttps://github.com/github
github-mcp-serverhttps://github.com/github/github-mcp-server
Codehttps://github.com/github/github-mcp-server
Issues238 (238)https://github.com/github/github-mcp-server/issues
Pull requests228 (228)https://github.com/github/github-mcp-server/pulls
Discussionshttps://github.com/github/github-mcp-server/discussions
Actionshttps://github.com/github/github-mcp-server/actions
Security and quality2 (2)https://github.com/github/github-mcp-server/security
Insightshttps://github.com/github/github-mcp-server/insights
https://github.com/github/github-mcp-server
New issuehttps://github.com/login?return_to=https://github.com/github/github-mcp-server/issues/3165
New issuehttps://github.com/login?return_to=https://github.com/github/github-mcp-server/issues/3165
#3177https://github.com/github/github-mcp-server/pull/3177
Read-modify-write through the MCP permanently destroys stored issue and PR body contenthttps://github.com/github/github-mcp-server/issues/3165#top
#3177https://github.com/github/github-mcp-server/pull/3177
https://github.com/arolling-sa
arolling-sahttps://github.com/arolling-sa
on Aug 26, 2026https://github.com/github/github-mcp-server/issues/3165#issue-5260928487
a00dc319https://github.com/github/github-mcp-server/commit/a00dc319edcb5f8a10f118b1dad649c94928aac4
#2202https://github.com/github/github-mcp-server/issues/2202
#2202https://github.com/github/github-mcp-server/issues/2202
@franklinjavier set this out in detail on #2202https://github.com/github/github-mcp-server/issues/2202#issuecomment-5429937295
flungo/claude-plugins#55https://github.com/flungo/claude-plugins/pull/55
@ericknavarro's census on #2202https://github.com/github/github-mcp-server/issues/2202#issuecomment-5149562849
56bfeec0https://github.com/github/github-mcp-server/commit/56bfeec0a9bd0ad6a6d88a047541d9e9acad8101
@ericknavarrohttps://github.com/github/github-mcp-server/issues/2202#issuecomment-5149562849
#2202https://github.com/github/github-mcp-server/issues/2202
#3035https://github.com/github/github-mcp-server/pull/3035
#3039https://github.com/github/github-mcp-server/pull/3039
#3040https://github.com/github/github-mcp-server/pull/3040
#3043https://github.com/github/github-mcp-server/pull/3043
#3043https://github.com/github/github-mcp-server/pull/3043
#2202https://github.com/github/github-mcp-server/issues/2202
#3106https://github.com/github/github-mcp-server/issues/3106
#3035https://github.com/github/github-mcp-server/pull/3035
#2408https://github.com/github/github-mcp-server/pull/2408
#2633https://github.com/github/github-mcp-server/pull/2633
#2308https://github.com/github/github-mcp-server/pull/2308
github-actionshttps://github.com/apps/github-actions
request ai reviewhttps://github.com/github/github-mcp-server/issues?q=state%3Aopen%20label%3A%22request%20ai%20review%22
request ai reviewhttps://github.com/github/github-mcp-server/issues?q=state%3Aopen%20label%3A%22request%20ai%20review%22
on Aug 26, 2026https://github.com/github/github-mcp-server/issues/3165#event-30065339037
https://github.com/arolling-sa
arolling-sahttps://github.com/arolling-sa
on Aug 26, 2026https://github.com/github/github-mcp-server/issues/3165#issuecomment-5430523447
#2202https://github.com/github/github-mcp-server/issues/2202
flungo/claude-plugins#55https://github.com/flungo/claude-plugins/pull/55
https://github.com/arolling-sa
arolling-sahttps://github.com/arolling-sa
on Aug 26, 2026https://github.com/github/github-mcp-server/issues/3165#issuecomment-5430682412
@franklinjavier's comment on #2202https://github.com/github/github-mcp-server/issues/2202#issuecomment-5429937295
SamMorrowDrumshttps://github.com/SamMorrowDrums
on Sep 1, 2026https://github.com/github/github-mcp-server/issues/3165#event-30335224710
fix(sanitize): close hidden content gapshttps://github.com/github/github-mcp-server/commit/8ae9501e9df0e9c1e38f38fd7ebac7a894448fd2
8ae9501https://github.com/github/github-mcp-server/commit/8ae9501e9df0e9c1e38f38fd7ebac7a894448fd2
fix(sanitize): preserve visible markdown contenthttps://github.com/github/github-mcp-server/commit/e65087a362560b26eb8c3fc5974188a6e07cccf7
e65087ahttps://github.com/github/github-mcp-server/commit/e65087a362560b26eb8c3fc5974188a6e07cccf7
fix(sanitize): close hidden content gapshttps://github.com/github/github-mcp-server/commit/b0e64f52ff5e8769a6064f78b5b5d7fc03d4c4f4
b0e64f5https://github.com/github/github-mcp-server/commit/b0e64f52ff5e8769a6064f78b5b5d7fc03d4c4f4
fix: preserve Markdown content in GitHub responseshttps://github.com/github/github-mcp-server/commit/1c4c824e68252a60bab5810c421cd8c0220e338e
1c4c824https://github.com/github/github-mcp-server/commit/1c4c824e68252a60bab5810c421cd8c0220e338e
fix: preserve Markdown content in GitHub responseshttps://github.com/github/github-mcp-server/commit/89b787e4bdf7a0e8b4da8bf2c1c6058c98ed8f6e
89b787ehttps://github.com/github/github-mcp-server/commit/89b787e4bdf7a0e8b4da8bf2c1c6058c98ed8f6e
fix: preserve Markdown content in GitHub responseshttps://github.com/github/github-mcp-server/commit/71ba0e88d99cc126dd7328f28f551eef8fcc5ce8
71ba0e8https://github.com/github/github-mcp-server/commit/71ba0e88d99cc126dd7328f28f551eef8fcc5ce8
fix(sanitize): preserve Markdown body fidelity on read surfaces (#3177)https://github.com/github/github-mcp-server/commit/25f11e629c912ab5a810486cefa15d433452e296
#3177https://github.com/github/github-mcp-server/pull/3177
25f11e6https://github.com/github/github-mcp-server/commit/25f11e629c912ab5a810486cefa15d433452e296
SamMorrowDrumshttps://github.com/SamMorrowDrums
completedhttps://github.com/github/github-mcp-server/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#3177https://github.com/github/github-mcp-server/pull/3177
on Sep 3, 2026https://github.com/github/github-mcp-server/issues/3165#event-30491213903
Sign up for freehttps://github.com/signup?return_to=https://github.com/github/github-mcp-server/issues/3165
Sign in to commenthttps://github.com/login?return_to=https://github.com/github/github-mcp-server/issues/3165
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.