Skip to content

Commit

Permalink
Updated Gemfile.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
BuffaloWill committed May 5, 2023
1 parent 0594702 commit c9dc00e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/python-docx-vulnerable/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM debian:stable-20230502-slim

# Install Python3 and pip3
RUN apt-get update && apt-get install -y python3 python3-pip

# Install python-docx library
RUN pip3 install python-docx==0.8.10
RUN pip3 install flask

# Set working directory
WORKDIR /app

# Copy your Python code to the container
COPY app.py .

# Run your Python code when the container starts
CMD ["python3", "app.py"]
19 changes: 19 additions & 0 deletions test/python-docx-vulnerable/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from flask import Flask, render_template, request
import docx

app = Flask(__name__)

@app.route('/', methods=['GET', 'POST'])
def upload_file():
if request.method == 'POST':
file = request.files['file']
if file:
document = docx.Document(file)
main_content = '\n\n'.join([paragraph.text for paragraph in document.paragraphs])
# Print the main content to the console
print(main_content)
return 'File uploaded and parsed successfully!'
return render_template('upload.html')

if __name__ == '__main__':
app.run(host='0.0.0.0')

0 comments on commit c9dc00e

Please sign in to comment.