René's URL Explorer Experiment


Title: Message.toWire(int) truncates 12 octets early since 3.7.0 (the header is counted twice) · Issue #436 · dnsjava/dnsjava · GitHub

Open Graph Title: Message.toWire(int) truncates 12 octets early since 3.7.0 (the header is counted twice) · Issue #436 · dnsjava/dnsjava

X Title: Message.toWire(int) truncates 12 octets early since 3.7.0 (the header is counted twice) · Issue #436 · dnsjava/dnsjava

Description: Since 3.7.0, Message.toWire(int maxLength) truncates a message 12 octets before maxLength. A message that fits the limit exactly comes back with TC set and its sections cut. What we see We stepped the message size one octet at a time aga...

Open Graph Description: Since 3.7.0, Message.toWire(int maxLength) truncates a message 12 octets before maxLength. A message that fits the limit exactly comes back with TC set and its sections cut. What we see We stepped ...

X Description: Since 3.7.0, Message.toWire(int maxLength) truncates a message 12 octets before maxLength. A message that fits the limit exactly comes back with TC set and its sections cut. What we see We stepped ...

Opengraph URL: https://github.com/dnsjava/dnsjava/issues/436

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Message.toWire(int) truncates 12 octets early since 3.7.0 (the header is counted twice)","articleBody":"Since 3.7.0, `Message.toWire(int maxLength)` truncates a message 12 octets before `maxLength`. A message that fits the limit exactly comes back with TC set and its sections cut.\n\n### What we see\n\nWe stepped the message size one octet at a time against a fixed limit:\n\n| limit | 3.6.4: largest whole / smallest truncated | 3.7.1: largest whole / smallest truncated |\n|---|---|---|\n| 512, with and without OPT | 512 / 513 | 500 / 501 |\n| 1232, with and without OPT | 1232 / 1233 | 1220 / 1221 |\n\nOn a UDP server this means every answer in the last 12 octets of the client's advertised payload size goes out with TC=1, and the client retries over TCP for an answer that would have fitted. We see it in production: a 510-octet negative answer to a client advertising 512, and an 837-octet signed NXDOMAIN to a client advertising anything from 837 to 848, both come back truncated.\n\n### Why\n\nIn `Message.toWire(DNSOutput, Compression, int)`, the budget is reduced by the header first (Message.java:498 in 3.7.1):\n\n```java\nint tempMaxLength = maxLength - Header.LENGTH;\n```\n\nand `sectionToWire` then compares the absolute write position against that reduced budget (Message.java:470):\n\n```java\nif (out.current() > maxLength) {   // maxLength here is tempMaxLength\n```\n\n`out.current()` already includes the 12 header octets written at `startpos`, so the header is counted twice. The TSIG and OPT reservations are fine; it is only the header.\n\nThis looks like it came in with 4f86d76c (\"Message: enforce toWire length\"), which was right to stop `toWire` from overshooting.\n\nA smaller related point: when the OPT record alone is larger than the budget, 3.7 throws `IllegalArgumentException`. A server rendering a response would rather get a truncated header plus question than an exception.\n\n### Suggested fix\n\nEither compare the bytes written since the header, `out.current() - startpos`, against `maxLength` less the TSIG and OPT reservations, or keep the absolute comparison and stop subtracting `Header.LENGTH`. Either way a message that fits `maxLength` exactly is rendered whole, and nothing ever exceeds `maxLength`, which is what 4f86d76c set out to guarantee.\n\nA test that renders messages of `maxLength - 1`, `maxLength` and `maxLength + 1` octets, with and without OPT and TSIG, and checks TC and the output length, would pin both directions.\n\nWe are working around it on our side by offering `toWire` the limit plus the measured hold-back, so there is no urgency from us. Happy to send a PR if that helps.\n\nThanks for dnsjava.\n\nKaveh Ranjbar\nWhisper Security\n","author":{"url":"https://github.com/kakooch","@type":"Person","name":"kakooch"},"datePublished":"2026-11-16T18:44:15Z","url":"https://github.com/dnsjava/dnsjava/issues/436"}

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:a13e225b-3fb1-f32b-ad18-da0bf51e2bb7
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA75A:3CBF9:85BFB1:AC8EB5:6B062BC4
html-safe-nonce7046b2f7d448d25dcda46c36652ff9990df9ea418d34ee4476fe22c8c06c758e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzVBOjNDQkY5Ojg1QkZCMTpBQzhFQjU6NkIwNjJCQzQiLCJ2aXNpdG9yX2lkIjoiMTUxNzk2NDQ4NjQyNTA2MjM0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac4253554db337801f8d7735d16e0970ac02691b18678fa806e3d312267f2a3a21
hovercard-subject-tagissue:6428199345
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/dnsjava/dnsjava/436/issue_layout
twitter:imagehttps://opengraph.githubassets.com/9367bf805d64f52ed42ccbf4c59f587ffd3a63475831a2ca5709aa7670e2e48d/dnsjava/dnsjava/issues/436
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/9367bf805d64f52ed42ccbf4c59f587ffd3a63475831a2ca5709aa7670e2e48d/dnsjava/dnsjava/issues/436
og:image:altSince 3.7.0, Message.toWire(int maxLength) truncates a message 12 octets before maxLength. A message that fits the limit exactly comes back with TC set and its sections cut. What we see We stepped ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekakooch
hostnamegithub.com
expected-hostnamegithub.com
None7f961de5dd5c5d4aca24d33f8b3ffb3fb8b2ef53d0a4f32f01f0a790e512f6d3
turbo-cache-controlno-preview
go-importgithub.com/dnsjava/dnsjava git https://github.com/dnsjava/dnsjava.git
octolytics-dimension-user_id6755615
octolytics-dimension-user_logindnsjava
octolytics-dimension-repository_id17084567
octolytics-dimension-repository_nwodnsjava/dnsjava
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id17084567
octolytics-dimension-repository_network_root_nwodnsjava/dnsjava
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
release494ea0bb1e0feef734a83e2628697647755e8864
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/dnsjava/dnsjava/issues/436#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdnsjava%2Fdnsjava%2Fissues%2F436
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%2Fdnsjava%2Fdnsjava%2Fissues%2F436
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=dnsjava%2Fdnsjava
Reloadhttps://github.com/dnsjava/dnsjava/issues/436
Reloadhttps://github.com/dnsjava/dnsjava/issues/436
Reloadhttps://github.com/dnsjava/dnsjava/issues/436
dnsjavahttps://github.com/dnsjava
dnsjavahttps://github.com/dnsjava/dnsjava
Codehttps://github.com/dnsjava/dnsjava
Issues16 (16)https://github.com/dnsjava/dnsjava/issues
Pull requests3 (3)https://github.com/dnsjava/dnsjava/pulls
Actionshttps://github.com/dnsjava/dnsjava/actions
Security and quality8 (8)https://github.com/dnsjava/dnsjava/security
Insightshttps://github.com/dnsjava/dnsjava/insights
https://github.com/dnsjava/dnsjava
New issuehttps://github.com/login?return_to=https://github.com/dnsjava/dnsjava/issues/436
New issuehttps://github.com/login?return_to=https://github.com/dnsjava/dnsjava/issues/436
Message.toWire(int) truncates 12 octets early since 3.7.0 (the header is counted twice)https://github.com/dnsjava/dnsjava/issues/436#top
bughttps://github.com/dnsjava/dnsjava/issues?q=state%3Aopen%20label%3A%22bug%22
3.7.2https://github.com/dnsjava/dnsjava/milestone/25
https://github.com/kakooch
kakoochhttps://github.com/kakooch
on Nov 16, 2026https://github.com/dnsjava/dnsjava/issues/436#issue-6428199345
4f86d76https://github.com/dnsjava/dnsjava/commit/4f86d76cc24e3e5c0692314f2fca277f8d486537
4f86d76https://github.com/dnsjava/dnsjava/commit/4f86d76cc24e3e5c0692314f2fca277f8d486537
https://github.com/ibauersachs
ibauersachshttps://github.com/ibauersachs
on Nov 21, 2026https://github.com/dnsjava/dnsjava/issues/436#issuecomment-7066110218
RFC 6891, Section 7https://www.rfc-editor.org/info/rfc6891/#section-7
ibauersachshttps://github.com/ibauersachs
bughttps://github.com/dnsjava/dnsjava/issues?q=state%3Aopen%20label%3A%22bug%22
on Nov 21, 2026https://github.com/dnsjava/dnsjava/issues/436#event-36872481980
ibauersachshttps://github.com/ibauersachs
3.7.2https://github.com/dnsjava/dnsjava/milestone/25
on Nov 21, 2026https://github.com/dnsjava/dnsjava/issues/436#event-36872488518
ibauersachshttps://github.com/ibauersachs
completedhttps://github.com/dnsjava/dnsjava/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
56ec379https://github.com/dnsjava/dnsjava/commit/56ec3790f5aed814a67db66f81ab73461c31b66d
on Nov 21, 2026https://github.com/dnsjava/dnsjava/issues/436#event-36872506447
sean-g-raehttps://github.com/sean-g-rae
on Nov 23, 2026https://github.com/dnsjava/dnsjava/issues/436#event-36958776216
Message: fix early truncationhttps://github.com/sean-g-rae/dnsjava/commit/56ec3790f5aed814a67db66f81ab73461c31b66d
https://docs.github.com/articles/closing-issues-via-commit-messages
56ec379https://github.com/sean-g-rae/dnsjava/commit/56ec3790f5aed814a67db66f81ab73461c31b66d
Sign up for freehttps://github.com/signup?return_to=https://github.com/dnsjava/dnsjava/issues/436
Sign in to commenthttps://github.com/login?return_to=https://github.com/dnsjava/dnsjava/issues/436
bughttps://github.com/dnsjava/dnsjava/issues?q=state%3Aopen%20label%3A%22bug%22
3.7.2No due datehttps://github.com/dnsjava/dnsjava/milestone/25
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.