Skip to content

[Security Issue] Apply secure_filename to snapshot_path for security hardening #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion devika.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@


from flask import Flask, request, jsonify, send_file
from werkzeug.utils import secure_filename
from flask_cors import CORS
from src.socket_instance import socketio, emit_agent
import os
Expand Down Expand Up @@ -123,7 +124,7 @@ def get_agent_state():
@app.route("/api/get-browser-snapshot", methods=["GET"])
@route_logger(logger)
def browser_snapshot():
snapshot_path = request.args.get("snapshot_path")
snapshot_path = secure_filename(request.args.get("snapshot_path"))
return send_file(snapshot_path, as_attachment=True)


Expand Down