ag235772 commited on
Commit
3f87767
·
1 Parent(s): 49c6518

Security Hardening: Removed unused iframe exceptions (Principle of Least Privilege)

Browse files
Files changed (1) hide show
  1. webpass/__init__.py +4 -6
webpass/__init__.py CHANGED
@@ -105,18 +105,16 @@ def create_app():
105
  if not session.get('bio_verified'):
106
  return redirect(url_for('bio.lock_screen'))
107
 
 
108
  # 5. SECURITY HEADERS
109
  # 5. SECURITY HEADERS
110
  @app.after_request
111
  def add_security_headers(response):
112
  response.headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubDomains'
113
 
114
- # The modern, precise way to whitelist specific domains for iframing
115
- # 'self' allows your own app, the URLs allow your specific domains
116
- response.headers['Content-Security-Policy'] = "frame-ancestors 'self' https://webpass.augsec.in https://huggingface.co;"
117
-
118
- # Note: We remove X-Frame-Options because CSP frame-ancestors replaces it
119
- # and is fully supported by all modern browsers.
120
 
121
  return response
122
 
 
105
  if not session.get('bio_verified'):
106
  return redirect(url_for('bio.lock_screen'))
107
 
108
+ # 5. SECURITY HEADERS
109
  # 5. SECURITY HEADERS
110
  # 5. SECURITY HEADERS
111
  @app.after_request
112
  def add_security_headers(response):
113
  response.headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubDomains'
114
 
115
+ # SLAMMING THE DOOR: Removed your custom domain since the Vercel Proxy doesn't need it.
116
+ # We only allow Hugging Face so your developer portfolio preview still works!
117
+ response.headers['Content-Security-Policy'] = "frame-ancestors 'self' https://huggingface.co;"
 
 
 
118
 
119
  return response
120