-
-
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
ac26510
commit 9b42eba
Showing
1 changed file
with
2 additions
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,8 @@ 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") or "/" in filename: | ||
allowed_files = ["README.md", "pull-request.md"] | ||
if filename not in allowed_files: | ||
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() | ||
|