René's URL Explorer Experiment


Title: fix(security): wire Trusted Types into the framework's HTML sinks by JosunLP · Pull Request #191 · bQuery/bQuery · GitHub

Open Graph Title: fix(security): wire Trusted Types into the framework's HTML sinks by JosunLP · Pull Request #191 · bQuery/bQuery

X Title: fix(security): wire Trusted Types into the framework's HTML sinks by JosunLP · Pull Request #191 · bQuery/bQuery

Description: Summary Fixes #171 (Medium). createTrustedHtml / getTrustedTypesPolicy existed but no DOM-write path called them — they were only re-exported. So under an enforced require-trusted-types-for 'script' CSP, every innerHTML =/insertAdjacentHTML in dom.ts/collection.ts/element.ts/directives threw (framework fails closed but non-functional), and the documented "Trusted Types / CSP compliance" property was simply absent. Fix New trustedHtmlForSink(rawHtml) in security/trusted-types.ts: returns a TrustedHTML when a policy is active (so the write satisfies enforced TT), otherwise the sanitized string — sanitizing exactly once. All sanitized sinks now route through it: core/dom.ts: setHtml, createElementFromHtml, insertContent core/collection.ts: Collection.html(), insertAll() view/directives: bq-html (sanitized branch), bq-html-safe element.ts html() inherits it via setHtml The explicit htmlUnsafe() / sanitize: false escape hatches are deliberately left as raw writes (bypassing sanitization is their documented purpose). The sanitizeHtml JSDoc is corrected to describe actual behavior (returns a branded string; the framework's sinks wrap it for TT). Verification New test proves the positive path: with a mock TT policy installed (fresh module instance to avoid cached-policy leakage), trustedHtmlForSink invokes policy.createHTML and returns the branded TrustedHTML. New test for the fallback path: returns a sanitized, sink-safe string in a non-TT environment. Existing sink sanitization tests still pass (behavior unchanged without TT). Full suite: 2988 pass / 0 fail. tsc --noEmit + eslint clean. 🤖 Generated with Claude Code

Open Graph Description: Summary Fixes #171 (Medium). createTrustedHtml / getTrustedTypesPolicy existed but no DOM-write path called them — they were only re-exported. So under an enforced require-trusted-types-for 'sc...

X Description: Summary Fixes #171 (Medium). createTrustedHtml / getTrustedTypesPolicy existed but no DOM-write path called them — they were only re-exported. So under an enforced require-trusted-types-for &#3...

Opengraph URL: https://github.com/bQuery/bQuery/pull/191

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d40807c8-96ad-536e-506f-2df8c8d53d4f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8A78:E21C4:3ACCB85:52B5C02:6A4F992E
html-safe-nonce9d8c4e3164064ff51b0796d6363be325361cd5bc044f857240704eb3c3a4786c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTc4OkUyMUM0OjNBQ0NCODU6NTJCNUMwMjo2QTRGOTkyRSIsInZpc2l0b3JfaWQiOiIxNjUyNTkyNzk0OTc5MjY5NTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1dd67c13f57755ff98aa0822ea1c3eb1187112469868c60924f9d5413fb349db
hovercard-subject-tagpull_request:4001082747
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/bQuery/bQuery/pull/191/files
twitter:imagehttps://avatars.githubusercontent.com/u/20913954?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/20913954?s=400&v=4
og:image:altSummary Fixes #171 (Medium). createTrustedHtml / getTrustedTypesPolicy existed but no DOM-write path called them — they were only re-exported. So under an enforced require-trusted-types-for 'sc...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git
octolytics-dimension-user_id256381806
octolytics-dimension-user_loginbQuery
octolytics-dimension-repository_id1139284244
octolytics-dimension-repository_nwobQuery/bQuery
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1139284244
octolytics-dimension-repository_network_root_nwobQuery/bQuery
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4b249b445842943ed31549e027f57a8ade9881ed
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/bQuery/bQuery/pull/191/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FbQuery%2FbQuery%2Fpull%2F191%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FbQuery%2FbQuery%2Fpull%2F191%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=bQuery%2FbQuery
Reloadhttps://github.com/bQuery/bQuery/pull/191/files
Reloadhttps://github.com/bQuery/bQuery/pull/191/files
Reloadhttps://github.com/bQuery/bQuery/pull/191/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/191/files
bQuery https://github.com/bQuery
bQueryhttps://github.com/bQuery/bQuery
Please reload this pagehttps://github.com/bQuery/bQuery/pull/191/files
Notifications https://github.com/login?return_to=%2FbQuery%2FbQuery
Fork 0 https://github.com/login?return_to=%2FbQuery%2FbQuery
Star 1 https://github.com/login?return_to=%2FbQuery%2FbQuery
Code https://github.com/bQuery/bQuery
Issues 0 https://github.com/bQuery/bQuery/issues
Pull requests 0 https://github.com/bQuery/bQuery/pulls
Actions https://github.com/bQuery/bQuery/actions
Security and quality 0 https://github.com/bQuery/bQuery/security
Insights https://github.com/bQuery/bQuery/pulse
Code https://github.com/bQuery/bQuery
Issues https://github.com/bQuery/bQuery/issues
Pull requests https://github.com/bQuery/bQuery/pulls
Actions https://github.com/bQuery/bQuery/actions
Security and quality https://github.com/bQuery/bQuery/security
Insights https://github.com/bQuery/bQuery/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FbQuery%2FbQuery%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FbQuery%2FbQuery%2Fissues%2Fnew%2Fchoose
JosunLPhttps://github.com/JosunLP
devhttps://github.com/bQuery/bQuery/tree/dev
fix/171-trusted-types-sinkshttps://github.com/bQuery/bQuery/tree/fix/171-trusted-types-sinks
Conversation 1 https://github.com/bQuery/bQuery/pull/191
Commits 1 https://github.com/bQuery/bQuery/pull/191/commits
Checks 8 https://github.com/bQuery/bQuery/pull/191/checks
Files changed https://github.com/bQuery/bQuery/pull/191/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/191/files
fix(security): wire Trusted Types into the framework's HTML sinks https://github.com/bQuery/bQuery/pull/191/files#top
Show all changes 1 commit https://github.com/bQuery/bQuery/pull/191/files
635e7b9 fix(security): wire Trusted Types into the framework's HTML sinks JosunLP Jul 6, 2026 https://github.com/bQuery/bQuery/pull/191/commits/635e7b9938f75398eb472bc6efea42bbc96d5826
Clear filters https://github.com/bQuery/bQuery/pull/191/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/191/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/191/files
collection.ts https://github.com/bQuery/bQuery/pull/191/files#diff-2d1b95a5cdec90bfea322b19fc129d617476087858709e3724c6902ea6327efe
dom.ts https://github.com/bQuery/bQuery/pull/191/files#diff-8d1059df963ae1de40785d8e14517eb439af623f6b1b8cda72054d6169784f81
full.ts https://github.com/bQuery/bQuery/pull/191/files#diff-3061502541780be549a3418b68cb60d2fbe8fc17f84f6ec533ce6bd0ab4eb95b
index.ts https://github.com/bQuery/bQuery/pull/191/files#diff-976e021644d0921e843b674e03a25a17a89063c0c9f19821d8b48b932ef9f820
sanitize.ts https://github.com/bQuery/bQuery/pull/191/files#diff-661a9f5ca84cb3668a2ebf96d24a7724d789597aad92ad19dc2ac9019b36e848
trusted-types.ts https://github.com/bQuery/bQuery/pull/191/files#diff-6ec1db1b4adf00f7e9866a9dd032678693af230688760f50337f601fd5f645fe
html.ts https://github.com/bQuery/bQuery/pull/191/files#diff-d5281ab7838bd0b31914facda29aec614482c7168c9708d74e66e76dd4e3f268
lightweight.ts https://github.com/bQuery/bQuery/pull/191/files#diff-9c1540e9a73a2fb3d100f0f2bdec988f51ad05ad4247d7af47a66dc07e031f33
security.test.ts https://github.com/bQuery/bQuery/pull/191/files#diff-1874ce6f3c03cecd7ffb4ab6788849648ad62622ebe474f2da8a70a454d087bc
src/core/collection.tshttps://github.com/bQuery/bQuery/pull/191/files#diff-2d1b95a5cdec90bfea322b19fc129d617476087858709e3724c6902ea6327efe
View file https://github.com/bQuery/bQuery/blob/635e7b9938f75398eb472bc6efea42bbc96d5826/src/core/collection.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/191/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/191/files#diff-2d1b95a5cdec90bfea322b19fc129d617476087858709e3724c6902ea6327efe
https://github.com/bQuery/bQuery/pull/191/files#diff-2d1b95a5cdec90bfea322b19fc129d617476087858709e3724c6902ea6327efe
https://github.com/bQuery/bQuery/pull/191/files#diff-2d1b95a5cdec90bfea322b19fc129d617476087858709e3724c6902ea6327efe
https://github.com/bQuery/bQuery/pull/191/files#diff-2d1b95a5cdec90bfea322b19fc129d617476087858709e3724c6902ea6327efe
https://github.com/bQuery/bQuery/pull/191/files#diff-2d1b95a5cdec90bfea322b19fc129d617476087858709e3724c6902ea6327efe
src/core/dom.tshttps://github.com/bQuery/bQuery/pull/191/files#diff-8d1059df963ae1de40785d8e14517eb439af623f6b1b8cda72054d6169784f81
View file https://github.com/bQuery/bQuery/blob/635e7b9938f75398eb472bc6efea42bbc96d5826/src/core/dom.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/191/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/191/files#diff-8d1059df963ae1de40785d8e14517eb439af623f6b1b8cda72054d6169784f81
https://github.com/bQuery/bQuery/pull/191/files#diff-8d1059df963ae1de40785d8e14517eb439af623f6b1b8cda72054d6169784f81
src/full.tshttps://github.com/bQuery/bQuery/pull/191/files#diff-3061502541780be549a3418b68cb60d2fbe8fc17f84f6ec533ce6bd0ab4eb95b
View file https://github.com/bQuery/bQuery/blob/635e7b9938f75398eb472bc6efea42bbc96d5826/src/full.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/191/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/191/files#diff-3061502541780be549a3418b68cb60d2fbe8fc17f84f6ec533ce6bd0ab4eb95b
https://github.com/bQuery/bQuery/pull/191/files#diff-3061502541780be549a3418b68cb60d2fbe8fc17f84f6ec533ce6bd0ab4eb95b
src/security/index.tshttps://github.com/bQuery/bQuery/pull/191/files#diff-976e021644d0921e843b674e03a25a17a89063c0c9f19821d8b48b932ef9f820
View file https://github.com/bQuery/bQuery/blob/635e7b9938f75398eb472bc6efea42bbc96d5826/src/security/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/191/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/191/files#diff-976e021644d0921e843b674e03a25a17a89063c0c9f19821d8b48b932ef9f820
src/security/sanitize.tshttps://github.com/bQuery/bQuery/pull/191/files#diff-661a9f5ca84cb3668a2ebf96d24a7724d789597aad92ad19dc2ac9019b36e848
View file https://github.com/bQuery/bQuery/blob/635e7b9938f75398eb472bc6efea42bbc96d5826/src/security/sanitize.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/191/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/191/files#diff-661a9f5ca84cb3668a2ebf96d24a7724d789597aad92ad19dc2ac9019b36e848
https://github.com/bQuery/bQuery/pull/191/files#diff-661a9f5ca84cb3668a2ebf96d24a7724d789597aad92ad19dc2ac9019b36e848
src/security/trusted-types.tshttps://github.com/bQuery/bQuery/pull/191/files#diff-6ec1db1b4adf00f7e9866a9dd032678693af230688760f50337f601fd5f645fe
View file https://github.com/bQuery/bQuery/blob/635e7b9938f75398eb472bc6efea42bbc96d5826/src/security/trusted-types.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/191/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/191/files#diff-6ec1db1b4adf00f7e9866a9dd032678693af230688760f50337f601fd5f645fe
src/view/directives/html.tshttps://github.com/bQuery/bQuery/pull/191/files#diff-d5281ab7838bd0b31914facda29aec614482c7168c9708d74e66e76dd4e3f268
View file https://github.com/bQuery/bQuery/blob/635e7b9938f75398eb472bc6efea42bbc96d5826/src/view/directives/html.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/191/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/191/files#diff-d5281ab7838bd0b31914facda29aec614482c7168c9708d74e66e76dd4e3f268
src/view/directives/lightweight.tshttps://github.com/bQuery/bQuery/pull/191/files#diff-9c1540e9a73a2fb3d100f0f2bdec988f51ad05ad4247d7af47a66dc07e031f33
View file https://github.com/bQuery/bQuery/blob/635e7b9938f75398eb472bc6efea42bbc96d5826/src/view/directives/lightweight.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/191/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/191/files#diff-9c1540e9a73a2fb3d100f0f2bdec988f51ad05ad4247d7af47a66dc07e031f33
https://github.com/bQuery/bQuery/pull/191/files#diff-9c1540e9a73a2fb3d100f0f2bdec988f51ad05ad4247d7af47a66dc07e031f33
https://github.com/bQuery/bQuery/pull/191/files#diff-9c1540e9a73a2fb3d100f0f2bdec988f51ad05ad4247d7af47a66dc07e031f33
tests/security.test.tshttps://github.com/bQuery/bQuery/pull/191/files#diff-1874ce6f3c03cecd7ffb4ab6788849648ad62622ebe474f2da8a70a454d087bc
View file https://github.com/bQuery/bQuery/blob/635e7b9938f75398eb472bc6efea42bbc96d5826/tests/security.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/191/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/191/files#diff-1874ce6f3c03cecd7ffb4ab6788849648ad62622ebe474f2da8a70a454d087bc
https://github.com/bQuery/bQuery/pull/191/files#diff-1874ce6f3c03cecd7ffb4ab6788849648ad62622ebe474f2da8a70a454d087bc
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

Viewport: width=device-width


URLs of crawlers that visited me.