René's URL Explorer Experiment


Title: Set content type to `application/json` for `flask.make_response` with JSON data by pixeebot[bot] · Pull Request #8 · earonesty/python-github-webhooks · GitHub

Open Graph Title: Set content type to `application/json` for `flask.make_response` with JSON data by pixeebot[bot] · Pull Request #8 · earonesty/python-github-webhooks

X Title: Set content type to `application/json` for `flask.make_response` with JSON data by pixeebot[bot] · Pull Request #8 · earonesty/python-github-webhooks

Description: The default mimetype for make_response in Flask is 'text/html'. This is true even when the response contains JSON data. If the JSON contains (unsanitized) user-supplied input, a malicious user may supply HTML code which leaves the application vulnerable to cross-site scripting (XSS). This fix explicitly sets the response type to application/json when the response body is JSON data to avoid this vulnerability. Our changes look something like this: from flask import make_response, Flask import json app = Flask(__name__) @app.route("/test") def foo(request): json_response = json.dumps({ "user_input": request.GET.get("input") }) - return make_response(json_response) + return make_response(json_response, {'Content-Type':'application/json'}) More reading https://flask.palletsprojects.com/en/2.3.x/patterns/javascript/#return-json-from-views https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html#output-encoding-for-javascript-contexts 🧚🤖 Powered by Pixeebot Feedback | Community | Docs | Codemod ID: pixee:python/flask-json-response-type

Open Graph Description: The default mimetype for make_response in Flask is 'text/html'. This is true even when the response contains JSON data. If the JSON contains (unsanitized) user-supplied input, a malicious u...

X Description: The default mimetype for make_response in Flask is 'text/html'. This is true even when the response contains JSON data. If the JSON contains (unsanitized) user-supplied input, a mal...

Opengraph URL: https://github.com/earonesty/python-github-webhooks/pull/8

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:dc7e73ee-ab58-9345-89a6-ae54f1a05cd7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC016:D0177:7A9371:A24856:6A62A64F
html-safe-noncebae3fddc364493b5003a903a03e8589f0d14308a956bcf395a7302d579282272
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMDE2OkQwMTc3OjdBOTM3MTpBMjQ4NTY6NkE2MkE2NEYiLCJ2aXNpdG9yX2lkIjoiMzM3MDk2MzY3MTY5OTMzNDczNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca21ad8ec93958eb739893e6f093b11ff6ec0ef996c408e3a6cd307e0a95d8ff3
hovercard-subject-tagpull_request:2050487119
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/earonesty/python-github-webhooks/pull/8/files
twitter:imagehttps://avatars.githubusercontent.com/in/193111?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/in/193111?s=400&v=4
og:image:altThe default mimetype for make_response in Flask is 'text/html'. This is true even when the response contains JSON data. If the JSON contains (unsanitized) user-supplied input, a malicious u...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonea6443033349a18134b517627f043d4a59a5110337b879810c7229c2c7e28eda0
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/earonesty/python-github-webhooks git https://github.com/earonesty/python-github-webhooks.git
octolytics-dimension-user_id50769
octolytics-dimension-user_loginearonesty
octolytics-dimension-repository_id140610530
octolytics-dimension-repository_nwoearonesty/python-github-webhooks
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id24353915
octolytics-dimension-repository_parent_nwocarlos-jenkins/python-github-webhooks
octolytics-dimension-repository_network_root_id24353915
octolytics-dimension-repository_network_root_nwocarlos-jenkins/python-github-webhooks
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released6c6cacbe32d3ddfd1796fbd1a39b8fb47b87daf
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/earonesty/python-github-webhooks/pull/8/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fearonesty%2Fpython-github-webhooks%2Fpull%2F8%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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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%2Fearonesty%2Fpython-github-webhooks%2Fpull%2F8%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=earonesty%2Fpython-github-webhooks
Reloadhttps://github.com/earonesty/python-github-webhooks/pull/8/files
Reloadhttps://github.com/earonesty/python-github-webhooks/pull/8/files
Reloadhttps://github.com/earonesty/python-github-webhooks/pull/8/files
earonesty https://github.com/earonesty
python-github-webhookshttps://github.com/earonesty/python-github-webhooks
carlos-jenkins/python-github-webhookshttps://github.com/carlos-jenkins/python-github-webhooks
Notifications https://github.com/login?return_to=%2Fearonesty%2Fpython-github-webhooks
Fork 0 https://github.com/login?return_to=%2Fearonesty%2Fpython-github-webhooks
Star 0 https://github.com/login?return_to=%2Fearonesty%2Fpython-github-webhooks
Code https://github.com/earonesty/python-github-webhooks
Pull requests 1 https://github.com/earonesty/python-github-webhooks/pulls
Actions https://github.com/earonesty/python-github-webhooks/actions
Projects https://github.com/earonesty/python-github-webhooks/projects
Wiki https://github.com/earonesty/python-github-webhooks/wiki
Security and quality 0 https://github.com/earonesty/python-github-webhooks/security
Insights https://github.com/earonesty/python-github-webhooks/pulse
Code https://github.com/earonesty/python-github-webhooks
Pull requests https://github.com/earonesty/python-github-webhooks/pulls
Actions https://github.com/earonesty/python-github-webhooks/actions
Projects https://github.com/earonesty/python-github-webhooks/projects
Wiki https://github.com/earonesty/python-github-webhooks/wiki
Security and quality https://github.com/earonesty/python-github-webhooks/security
Insights https://github.com/earonesty/python-github-webhooks/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fearonesty%2Fpython-github-webhooks%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fearonesty%2Fpython-github-webhooks%2Fissues%2Fnew%2Fchoose
pixeebothttps://github.com/apps/pixeebot
masterhttps://github.com/earonesty/python-github-webhooks/tree/master
pixeebot/drip-2024-09-03-pixee-python/flask-json-response-typehttps://github.com/earonesty/python-github-webhooks/tree/pixeebot/drip-2024-09-03-pixee-python/flask-json-response-type
Conversation 1 https://github.com/earonesty/python-github-webhooks/pull/8
Commits 1 https://github.com/earonesty/python-github-webhooks/pull/8/commits
Checks 0 https://github.com/earonesty/python-github-webhooks/pull/8/checks
Files changed https://github.com/earonesty/python-github-webhooks/pull/8/files
Please reload this pagehttps://github.com/earonesty/python-github-webhooks/pull/8/files
Set content type to application/json for flask.make_response with JSON data https://github.com/earonesty/python-github-webhooks/pull/8/files#top
Show all changes 1 commit https://github.com/earonesty/python-github-webhooks/pull/8/files
a1330fe Set content type to `application/json` for `flask.make_response` with… pixeebot[bot] Sep 3, 2024 https://github.com/earonesty/python-github-webhooks/pull/8/commits/a1330fe16d531e34ddfad6433dac97fdf6c0c1eb
Clear filters https://github.com/earonesty/python-github-webhooks/pull/8/files
Please reload this pagehttps://github.com/earonesty/python-github-webhooks/pull/8/files
Please reload this pagehttps://github.com/earonesty/python-github-webhooks/pull/8/files
webhooks.pyhttps://github.com/earonesty/python-github-webhooks/pull/8/files#diff-0f16f83adb13487a5a3c4d816fff66935e3a315c15f161df717b7ca0edfad2e1
View file https://github.com/earonesty/python-github-webhooks/blob/a1330fe16d531e34ddfad6433dac97fdf6c0c1eb/webhooks.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/earonesty/python-github-webhooks/pull/8/{{ revealButtonHref }}
https://github.com/earonesty/python-github-webhooks/pull/8/files#diff-0f16f83adb13487a5a3c4d816fff66935e3a315c15f161df717b7ca0edfad2e1
https://github.com/earonesty/python-github-webhooks/pull/8/files#diff-0f16f83adb13487a5a3c4d816fff66935e3a315c15f161df717b7ca0edfad2e1
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.