
Insecure attachment handling when using Canary Mail or Blue mail
The core issue is not that users open malicious attachments, but that apps like Canary Mail or Blue Mail provide a convenient yet insecure feature for saving or opening them. I consider this a security vulnerability that exposes users to attackers.
To demonstrate the insecure opening of Office Word attachments via the "Open with" or "Save as" dialog box, vulnerability CVE-2017-11882 in the equation editor for Office Word 16 and below was used.
from flask import Flask, send_file, request
import logging
from datetime import datetime
app = Flask(__name__)
# Configure logging
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
@app.before_request
def log_request_info():
logger.info(f'Request: {request.method} {request.url} from {request.remote_addr}')
@app.after_request
def log_response_info(response):
logger.info(f'Response: Status {response.status_code} for {request.url}')
return response
@app.route('/download')
def download_file():
try:
response = send_file('exploit.rtf', mimetype='application/msword', as_attachment=True)
logger.info('File download successful')
return response
except FileNotFoundError:
logger.error('File exploit.rtf not found')
return 'File not found', 404
if __name__ == '__main__':
app.run(debug=False, host='0.0.0.0', port=5000)
A potential RCE for users using outdated Microsoft Office Word software versions 16 and below
This repository is for educational and defensive security research only