Title: Codemod: path-traversal-join Semgrep · Issue #685 · pixee/codemodder-python · GitHub
Open Graph Title: Codemod: path-traversal-join Semgrep · Issue #685 · pixee/codemodder-python
X Title: Codemod: path-traversal-join Semgrep · Issue #685 · pixee/codemodder-python
Description: running semgrep on pygoat ❯❱ python.django.security.injection.path-traversal.path-traversal-join.path-traversal-join Data from request is passed to os.path.join() and to open(). This is a path traversal vulnerability, which can lead to s...
Open Graph Description: running semgrep on pygoat ❯❱ python.django.security.injection.path-traversal.path-traversal-join.path-traversal-join Data from request is passed to os.path.join() and to open(). This is a path trav...
X Description: running semgrep on pygoat ❯❱ python.django.security.injection.path-traversal.path-traversal-join.path-traversal-join Data from request is passed to os.path.join() and to open(). This is a path trav...
Opengraph URL: https://github.com/pixee/codemodder-python/issues/685
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Codemod: path-traversal-join Semgrep","articleBody":"running semgrep on pygoat\r\n```\r\n ❯❱ python.django.security.injection.path-traversal.path-traversal-join.path-traversal-join\r\n Data from request is passed to os.path.join() and to open(). This is a path traversal vulnerability,\r\n which can lead to sensitive data being leaked. To mitigate, consider using os.path.abspath or \r\n os.path.realpath or Path library. \r\n Details: https://sg.run/Dovo \r\n \r\n 916┆ file=request.POST[\"blog\"]\r\n 917┆ try :\r\n 918┆ dirname = os.path.dirname(__file__)\r\n 919┆ filename = os.path.join(dirname, file)\r\n 920┆ file = open(filename,\"r\")\r\n 921┆ data = file.read()\r\n 922┆ return render(request,\"Lab/ssrf/ssrf_lab.html\",{\"blog\":data})\r\n 923┆ except:\r\n 924┆ return render(request, \"Lab/ssrf/ssrf_lab.html\", {\"blog\": \"No blog found\"})\r\n \r\n```\r\n\r\nI don't believe we currently have a codemod for this pattern, but we could use deterministically try to implement the suggestion semgrep is giving us.","author":{"url":"https://github.com/clavedeluna","@type":"Person","name":"clavedeluna"},"datePublished":"2024-07-01T11:50:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/685/codemodder-python/issues/685"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6541aa3a-f854-4372-5e28-805b32896bab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B968:29B36B:B8F1E2:103B72E:6970BC18 |
| html-safe-nonce | 15086967877eeb9ce4cc08258dd85946ee2fd5efca4bb08d6c7729dfa0e6b321 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTY4OjI5QjM2QjpCOEYxRTI6MTAzQjcyRTo2OTcwQkMxOCIsInZpc2l0b3JfaWQiOiI3OTk0NzEwMzM2MjM1MTU4NTUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9971ad91a93e1b8fa9c5eb164159e9b80510a5df55e7aed6ef661cce80e1fe4a |
| hovercard-subject-tag | issue:2383634258 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pixee/codemodder-python/685/issue_layout |
| twitter:image | https://opengraph.githubassets.com/83d30059d7fd8f452e687854c5f50ba5830d104cc28561af435084d04fee0314/pixee/codemodder-python/issues/685 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/83d30059d7fd8f452e687854c5f50ba5830d104cc28561af435084d04fee0314/pixee/codemodder-python/issues/685 |
| og:image:alt | running semgrep on pygoat ❯❱ python.django.security.injection.path-traversal.path-traversal-join.path-traversal-join Data from request is passed to os.path.join() and to open(). This is a path trav... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | clavedeluna |
| hostname | github.com |
| expected-hostname | github.com |
| None | bb43a7bc61aba1b91c3c5cf8e7d00342e1e77a0cfe55a141222dbd7f9782d26f |
| turbo-cache-control | no-preview |
| go-import | github.com/pixee/codemodder-python git https://github.com/pixee/codemodder-python.git |
| octolytics-dimension-user_id | 101823672 |
| octolytics-dimension-user_login | pixee |
| octolytics-dimension-repository_id | 682639394 |
| octolytics-dimension-repository_nwo | pixee/codemodder-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 682639394 |
| octolytics-dimension-repository_network_root_nwo | pixee/codemodder-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 34817b01ad7cdf8b2beb35ea7b0e2a7609004eff |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width