We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61de8b0 commit 080a29cCopy full SHA for 080a29c
webhook.py
@@ -156,8 +156,10 @@ async def github_webhook(request: web.Request):
156
delivery, ref, expected_branch)
157
return web.Response(status=200)
158
159
- checkout = Path(os.environ.get('SITE_DIR', 'sites'), repository)
160
- if not (checkout / '.git').is_dir():
+ site_dir = Path(os.environ.get('SITE_DIR', 'sites'))
+ checkout = (site_dir / repository).resolve()
161
+ if (not checkout.is_relative_to(site_dir) or
162
+ not (checkout / '.git').is_dir()):
163
raise web.HTTPInternalServerError(
164
reason=(f'{delivery}: Checkout for {organization}/{repository} '
165
'does not exist'))
0 commit comments