-
Notifications
You must be signed in to change notification settings - Fork 470
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
feat: AI-Powered Content Assistance: Auto-Fill, Spell Check, and Content Enhancement for Contentlets [DONT MERGE] #31314
Conversation
…l-spellcheck-enhancement' of github.com:dotCMS/core into hackathon-2025-q1-feature-ai-content-assistance-autofill-spellcheck-enhancement
|
||
const app = new Hono(); | ||
|
||
app.use("*", cors()); |
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.
Semgrep identified an issue in your code:
Having default CORS settings is insecure because they often allow overly permissive cross-origin access, exposing your application to unauthorized data sharing, potentially exposing sensitive data to malicious websites. Avoid using wildcard (*) origins, especially for endpoints that handle sensitive data. Use a restrictive CORS policy by explicitly specifying trusted origins in the Access-Control-Allow-Origin header.
To resolve this comment:
✨ Commit Assistant fix suggestion
app.use("*", cors()); | |
const allowedOrigins = process.env.ALLOWED_ORIGINS.split(','); | |
app.use("*", cors({ | |
origin: allowedOrigins | |
})); |
View step-by-step instructions
-
Identify the trusted origins that should be allowed to access your application. These are the domains you expect to interact with your API.
-
Replace the wildcard origin in the
cors
middleware with an explicit list of trusted origins. Modify thecors
configuration as follows:app.use("*", cors({ origin: ["https://trusted-origin1.com", "https://trusted-origin2.com"] }));
-
If you have multiple environments (e.g., development, staging, production), consider using environment variables to manage the list of allowed origins. This can be done by updating your
.env
file and accessing the variables in your code:const allowedOrigins = process.env.ALLOWED_ORIGINS.split(','); app.use("*", cors({ origin: allowedOrigins }));
Ensure your
.env
file contains a line like:ALLOWED_ORIGINS=https://trusted-origin1.com,https://trusted-origin2.com
By specifying trusted origins, you reduce the risk of unauthorized cross-origin requests and protect sensitive data from being exposed to malicious websites.
💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>
for false positive/ar <comment>
for acceptable risk/other <comment>
for all other reasons
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by cors-default-config-express.
You can view more details about this finding in the Semgrep AppSec Platform.
…l-spellcheck-enhancement' of github.com:dotCMS/core into hackathon-2025-q1-feature-ai-content-assistance-autofill-spellcheck-enhancement
…l-spellcheck-enhancement' of https://github.com/dotCMS/core into hackathon-2025-q1-feature-ai-content-assistance-autofill-spellcheck-enhancement
Semgrep found 3 Risk: Affected versions of rollup are vulnerable to Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'). Manual Review Advice: A vulnerability from this advisory is reachable if you use Rollup to bundle JavaScript with Fix: Upgrade this library to at least version 4.22.4 at core/core-web/package-lock.json:51752. Reference(s): GHSA-gcx4-mw62-g8wm, CVE-2024-47068 Semgrep found 1 Risk: http-cache-semantics versions before 4.1.1 are vulnerable to Inefficient Regular Expression Complexity leading to Denial of Service. The issue can be exploited via malicious request header values sent to a server, when that server reads the cache policy from the request using this library. Fix: Upgrade this library to at least version 4.1.1 at core/core-web/package-lock.json:43387. Reference(s): GHSA-rc47-6667-2j5j, CVE-2022-25881 |
Legal RiskThe following dependencies were released under a license that RecommendationWhile merging is not directly blocked, it's best to pause and consider what it means to use this license before continuing. If you are unsure, reach out to your security team or Semgrep admin to address this issue. EPL-2.0 GPL-2.0 MPL-2.0 |
…l-spellcheck-enhancement' of github.com:dotCMS/core into hackathon-2025-q1-feature-ai-content-assistance-autofill-spellcheck-enhancement
…l-spellcheck-enhancement' of github.com:dotCMS/core into hackathon-2025-q1-feature-ai-content-assistance-autofill-spellcheck-enhancement
…l-spellcheck-enhancement' of https://github.com/dotCMS/core into hackathon-2025-q1-feature-ai-content-assistance-autofill-spellcheck-enhancement
…l-spellcheck-enhancement' of github.com:dotCMS/core into hackathon-2025-q1-feature-ai-content-assistance-autofill-spellcheck-enhancement
…l-spellcheck-enhancement' of github.com:dotCMS/core into hackathon-2025-q1-feature-ai-content-assistance-autofill-spellcheck-enhancement
No description provided.