René's URL Explorer Experiment


Title: Java: CWE-552 Query to detect unsafe request dispatcher usage by luchua-bc · Pull Request #7286 · github/codeql · GitHub

Open Graph Title: Java: CWE-552 Query to detect unsafe request dispatcher usage by luchua-bc · Pull Request #7286 · github/codeql

X Title: Java: CWE-552 Query to detect unsafe request dispatcher usage by luchua-bc · Pull Request #7286 · github/codeql

Description: Directly incorporating user input into HTTP requests dispatched from the Java EE RequestDispatcher without proper validation of the input can allow any web application resource such as configuration files and source code to be disclosed. As stated in the Java API doc, when using a Java EE RequestDispatcher, requests may be dispatched to any part of the web application bypassing both implicit (no direct access to WEB-INF or META-INF) and explicit (defined by the web application) security constraints. Unsanitized user provided data must not be used to construct the path passed to the RequestDispatcher as it is very likely to create a security vulnerability in the application. This query detects unsafe invocations of RequestDispatcher with user controlled input. Important features include: RequestDispatcher constructed from both HTTP request and servlet context Path traversal check Path encoding check Check of path normalization using the java.nio.file.Path package The query was previously submitted then closed to wait for the closing of another relevant PR. The current query provided further enhancement in addition to new scenarios and was validated against published CVEs. Please consider to merge the PR. Thanks.

Open Graph Description: Directly incorporating user input into HTTP requests dispatched from the Java EE RequestDispatcher without proper validation of the input can allow any web application resource such as configuratio...

X Description: Directly incorporating user input into HTTP requests dispatched from the Java EE RequestDispatcher without proper validation of the input can allow any web application resource such as configuratio...

Opengraph URL: https://github.com/github/codeql/pull/7286

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:696640ba-e944-69e1-c551-9eb8893b9459
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB58C:227D33:A44415:E10318:6A4C8CA7
html-safe-noncedab24f81d2ad81f22928aef64020712edcd33b40235a68e9ba7b80c906a114e2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNThDOjIyN0QzMzpBNDQ0MTU6RTEwMzE4OjZBNEM4Q0E3IiwidmlzaXRvcl9pZCI6IjQyNjUwOTY0MTc1ODU3NTc4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac5d4572912ae7a83bd9666c70ddf84db6a852782aefbb7486122d42b523c128b6
hovercard-subject-tagpull_request:793316929
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/github/codeql/pull/7286/files
twitter:imagehttps://avatars.githubusercontent.com/u/37377780?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/37377780?s=400&v=4
og:image:altDirectly incorporating user input into HTTP requests dispatched from the Java EE RequestDispatcher without proper validation of the input can allow any web application resource such as configuratio...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/github/codeql git https://github.com/github/codeql.git
octolytics-dimension-user_id9919
octolytics-dimension-user_logingithub
octolytics-dimension-repository_id143040428
octolytics-dimension-repository_nwogithub/codeql
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id143040428
octolytics-dimension-repository_network_root_nwogithub/codeql
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
release7a2dede45637df6b92ddcfe2a557e67d4b5854ae
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/github/codeql/pull/7286/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgithub%2Fcodeql%2Fpull%2F7286%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/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/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/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%2Fgithub%2Fcodeql%2Fpull%2F7286%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=github%2Fcodeql
Reloadhttps://github.com/github/codeql/pull/7286/files
Reloadhttps://github.com/github/codeql/pull/7286/files
Reloadhttps://github.com/github/codeql/pull/7286/files
Please reload this pagehttps://github.com/github/codeql/pull/7286/files
github https://github.com/github
codeqlhttps://github.com/github/codeql
Notifications https://github.com/login?return_to=%2Fgithub%2Fcodeql
Fork 2k https://github.com/login?return_to=%2Fgithub%2Fcodeql
Star 9.8k https://github.com/login?return_to=%2Fgithub%2Fcodeql
Code https://github.com/github/codeql
Issues 987 https://github.com/github/codeql/issues
Pull requests 424 https://github.com/github/codeql/pulls
Discussions https://github.com/github/codeql/discussions
Actions https://github.com/github/codeql/actions
Projects https://github.com/github/codeql/projects
Models https://github.com/github/codeql/models
Security and quality 0 https://github.com/github/codeql/security
Insights https://github.com/github/codeql/pulse
Code https://github.com/github/codeql
Issues https://github.com/github/codeql/issues
Pull requests https://github.com/github/codeql/pulls
Discussions https://github.com/github/codeql/discussions
Actions https://github.com/github/codeql/actions
Projects https://github.com/github/codeql/projects
Models https://github.com/github/codeql/models
Security and quality https://github.com/github/codeql/security
Insights https://github.com/github/codeql/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fgithub%2Fcodeql%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fgithub%2Fcodeql%2Fissues%2Fnew%2Fchoose
smowtonhttps://github.com/smowton
github:mainhttps://github.com/github/codeql/tree/main
luchua-bc:java/unsafe-url-forward-dispatchhttps://github.com/luchua-bc/ql/tree/java/unsafe-url-forward-dispatch
Conversation 67 https://github.com/github/codeql/pull/7286
Findings https://github.com/github/codeql/pull/7286/findings
Commits 17 https://github.com/github/codeql/pull/7286/commits
Checks 0 https://github.com/github/codeql/pull/7286/checks
Files changed https://github.com/github/codeql/pull/7286/files
Please reload this pagehttps://github.com/github/codeql/pull/7286/files
Java: CWE-552 Query to detect unsafe request dispatcher usage https://github.com/github/codeql/pull/7286/files#top
Show all changes 17 commits https://github.com/github/codeql/pull/7286/files
8bcffc2 Query to detect unsafe request dispatcher usage luchua-bc Dec 2, 2021 https://github.com/github/codeql/pull/7286/commits/8bcffc2886f3c17d6083287d4177f053683e36db
29ce0e9 Add sanitizer for virtual method calls luchua-bc Dec 15, 2021 https://github.com/github/codeql/pull/7286/commits/29ce0e9ef19a46bf756472b8a3956a19cda443be
263dbd3 Optimize the query luchua-bc Jan 12, 2022 https://github.com/github/codeql/pull/7286/commits/263dbd33f6b908940e1b6d205652ccde050a35d6
cd9a485 Refactor NullOrEmptyCheckGuard atorralba Jan 13, 2022 https://github.com/github/codeql/pull/7286/commits/cd9a485c47a9ae8c4145fffaaba8e4bc435bdfdf
81feaae Refactor PathMatchGuard atorralba Jan 13, 2022 https://github.com/github/codeql/pull/7286/commits/81feaaec0270c7b9635d539eaa7f3877d34e9340
b6886b8 Move code to qll file atorralba Jan 13, 2022 https://github.com/github/codeql/pull/7286/commits/b6886b8e4385f5857f62d27395d85d1ee2fe4227
877c529 Remove the deprecated library keyword luchua-bc Jan 14, 2022 https://github.com/github/codeql/pull/7286/commits/877c52981ff3b333d13cdb802b7f3592e5d753bc
136fefb Apply suggestions from code review atorralba Jan 14, 2022 https://github.com/github/codeql/pull/7286/commits/136fefbab55fe4ec9f2cec51feeddbf2c37ec9fa
fb1287d Use dominance instead of getParent atorralba Jan 14, 2022 https://github.com/github/codeql/pull/7286/commits/fb1287d577d09cfd6710b51c466351e47fd624c4
eb1806c Split PathMatchGuard into three guards atorralba Jan 14, 2022 https://github.com/github/codeql/pull/7286/commits/eb1806c0a92d23dbd87fcc9b62fb11d1c5370711
a2c98ba Reordering atorralba Jan 14, 2022 https://github.com/github/codeql/pull/7286/commits/a2c98baf29941f171128f21e189b18b7604b8b68
978ef15 Update method names luchua-bc Jan 16, 2022 https://github.com/github/codeql/pull/7286/commits/978ef1570a7fcbefdedb5a75a5a484e33f45b323
4797fce Update use cases and qldoc luchua-bc Jan 16, 2022 https://github.com/github/codeql/pull/7286/commits/4797fce48a3d78adc95223a25a027f5e992cf078
a3d65a8 Update recommendation in qldoc and make examples more comprehendible luchua-bc Jan 18, 2022 https://github.com/github/codeql/pull/7286/commits/a3d65a8ed0663b044f6c9d9828cc3f60db5395c9
748008a Remove dangling reference to UnsafeRequestPath.java smowton Jan 18, 2022 https://github.com/github/codeql/pull/7286/commits/748008ad517be80dfff4de9a867b7d9e181a19ae
d744cf9 Clean up guard logic: smowton Jan 18, 2022 https://github.com/github/codeql/pull/7286/commits/d744cf9053442a1067162ff75bef8028b686f270
1e32514 Avoid using `this` for a non-extending supertype, and remove needless… smowton Jan 18, 2022 https://github.com/github/codeql/pull/7286/commits/1e32514600132eb40d7a5c9944efb0ff926992c6
Clear filters https://github.com/github/codeql/pull/7286/files
Please reload this pagehttps://github.com/github/codeql/pull/7286/files
Please reload this pagehttps://github.com/github/codeql/pull/7286/files
Servlets.qll https://github.com/github/codeql/pull/7286/files#diff-33368733f046f32b4d0f28bebe9c0451ca1ce54376de355f82992b8b82f63083
UnsafeServletRequestDispatch.java https://github.com/github/codeql/pull/7286/files#diff-805730cadcfe1d72986a16492864bb2a853e59d650ac947b163182cc8d6ecec3
UnsafeUrlForward.qhelp https://github.com/github/codeql/pull/7286/files#diff-3e5cfcc60b5abc0126d377789c00f2606f31d2cb303c412acca9c927e0a0d722
UnsafeUrlForward.ql https://github.com/github/codeql/pull/7286/files#diff-3caec98bb63246165cd000f9dbbac654f2cd460af72d62cc2b6c0001f62eaf5e
UnsafeUrlForward.qll https://github.com/github/codeql/pull/7286/files#diff-171b613f67732add15b5c1b18e1c983ed4522338e7debe776016bcd4f13ffcba
UnsafeRequestPath.java https://github.com/github/codeql/pull/7286/files#diff-5bd5df81382259b5c474e0903462951c316c4b034fa3c9415fb1c0e50df98eda
UnsafeServletRequestDispatch.java https://github.com/github/codeql/pull/7286/files#diff-6bc44c5765a6e460db430d2c13a69b22afe818b46bc96d630508b5e1d1cd6eb1
UnsafeUrlForward.expected https://github.com/github/codeql/pull/7286/files#diff-cee29b69dfd9b0b1243fd0589f66ac94dfd0c3b43cd5de6892331df28db85f95
UnsafeUrlForward.java https://github.com/github/codeql/pull/7286/files#diff-5d1cb9b9bddca39c10c82f29297e86482034283701a68060207e54253793e3f3
HttpServletRequest.java https://github.com/github/codeql/pull/7286/files#diff-0ae0fe89484194157999bd5737ef73e8574ec491cdcc5bc708b980b0537a07e4
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/lib/semmle/code/java/frameworks/Servlets.qllhttps://github.com/github/codeql/pull/7286/files#diff-33368733f046f32b4d0f28bebe9c0451ca1ce54376de355f82992b8b82f63083
View file https://github.com/luchua-bc/ql/blob/1e32514600132eb40d7a5c9944efb0ff926992c6/java/ql/lib/semmle/code/java/frameworks/Servlets.qll
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/7286/{{ revealButtonHref }}
https://github.com/github/codeql/pull/7286/files#diff-33368733f046f32b4d0f28bebe9c0451ca1ce54376de355f82992b8b82f63083
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-552/UnsafeServletRequestDispatch.javahttps://github.com/github/codeql/pull/7286/files#diff-805730cadcfe1d72986a16492864bb2a853e59d650ac947b163182cc8d6ecec3
View file https://github.com/luchua-bc/ql/blob/1e32514600132eb40d7a5c9944efb0ff926992c6/java/ql/src/experimental/Security/CWE/CWE-552/UnsafeServletRequestDispatch.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/7286/{{ revealButtonHref }}
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-552/UnsafeUrlForward.qhelphttps://github.com/github/codeql/pull/7286/files#diff-3e5cfcc60b5abc0126d377789c00f2606f31d2cb303c412acca9c927e0a0d722
View file https://github.com/luchua-bc/ql/blob/1e32514600132eb40d7a5c9944efb0ff926992c6/java/ql/src/experimental/Security/CWE/CWE-552/UnsafeUrlForward.qhelp
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/7286/{{ revealButtonHref }}
https://github.com/github/codeql/pull/7286/files#diff-3e5cfcc60b5abc0126d377789c00f2606f31d2cb303c412acca9c927e0a0d722
Please reload this pagehttps://github.com/github/codeql/pull/7286/files
https://github.com/github/codeql/blob/main/CODEOWNERS#L16
java/ql/src/experimental/Security/CWE/CWE-552/UnsafeUrlForward.qlhttps://github.com/github/codeql/pull/7286/files#diff-3caec98bb63246165cd000f9dbbac654f2cd460af72d62cc2b6c0001f62eaf5e
View file https://github.com/luchua-bc/ql/blob/1e32514600132eb40d7a5c9944efb0ff926992c6/java/ql/src/experimental/Security/CWE/CWE-552/UnsafeUrlForward.ql
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/github/codeql/pull/7286/{{ revealButtonHref }}
https://github.com/github/codeql/pull/7286/files#diff-3caec98bb63246165cd000f9dbbac654f2cd460af72d62cc2b6c0001f62eaf5e
https://github.com/github/codeql/pull/7286/files#diff-3caec98bb63246165cd000f9dbbac654f2cd460af72d62cc2b6c0001f62eaf5e
Please reload this pagehttps://github.com/github/codeql/pull/7286/files
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.