-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87d2a70
commit ac26510
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,7 @@ def index(): | |
@app.route("/<path:filename>", methods=["GET"]) | ||
def file(filename): | ||
"""Convert a md file into HTML and return it""" | ||
if not filename.endswith(".md"): | ||
if not filename.endswith(".md") or "/" in filename: | ||
abort(404) | ||
with open(filename) as f: | ||
Check failure Code scanning / SonarCloud I/O function calls should not be vulnerable to path injection attacks High
Change this code to not construct the path from user-controlled data. See more on SonarCloud
|
||
md = f.read() | ||
|