-
Notifications
You must be signed in to change notification settings - Fork 31
Fix/extensive security remediation 55 #100
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| [ | ||
| { | ||
| "AllowedHeaders": [ | ||
| "*" | ||
| ], | ||
| "AllowedMethods": [ | ||
| "GET", | ||
| "PUT", | ||
| "POST", | ||
| "DELETE", | ||
| "HEAD" | ||
| ], | ||
|
Comment on lines
+6
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Search for S3 DELETE operations initiated from client-side code.
# Search for DELETE method calls to S3 in JavaScript/TypeScript frontend code
rg -n -C3 --type=js --type=ts -i 'DELETE.*s3|s3.*DELETE|deleteObject' -g '!node_modules/**' -g '!vendor/**'
# Search for S3 client DELETE in PHP backend (in case DELETE is proxied)
rg -n -C3 --type=php 'deleteObject|DeleteObject' -g '!vendor/**'Repository: BAWES-Universe/studenthub Length of output: 50381 Remove the No client-side or backend S3 DELETE operations were found in the codebase. Allowing DELETE from cross-origin requests unnecessarily expands the attack surface; remove it to improve security posture. 🤖 Prompt for AI Agents |
||
| "AllowedOrigins": [ | ||
| "https://studenthub.co", | ||
| "https://staff.api.studenthub.co", | ||
| "https://student.api.studenthub.co" | ||
| ], | ||
| "ExposeHeaders": [ | ||
| "ETag", | ||
| "x-amz-server-side-encryption", | ||
| "x-amz-request-id", | ||
| "x-amz-id-2" | ||
| ], | ||
| "MaxAgeSeconds": 3000 | ||
| } | ||
| ] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restrict
AllowedHeadersto specific headers required by the application.The wildcard
"*"permits any request header from browser origins, violating the principle of least privilege and potentially enabling CSRF or header injection attacks. Enumerate only the headers your application requires.🔒 Proposed fix to restrict headers
Note: Adjust the list above to match only the headers your application actually sends in S3 requests.
🤖 Prompt for AI Agents