Skip to content
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

rjvelazco
Copy link
Contributor

No description provided.

@rjvelazco rjvelazco changed the title feat: create floating dialog component feat: AI-Powered Content Assistance: Auto-Fill, Spell Check, and Content Enhancement for Contentlets Feb 6, 2025
…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());

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

Suggested change
app.use("*", cors());
const allowedOrigins = process.env.ALLOWED_ORIGINS.split(',');
app.use("*", cors({
origin: allowedOrigins
}));
View step-by-step instructions
  1. Identify the trusted origins that should be allowed to access your application. These are the domains you expect to interact with your API.

  2. Replace the wildcard origin in the cors middleware with an explicit list of trusted origins. Modify the cors configuration as follows:

    app.use("*", cors({
      origin: ["https://trusted-origin1.com", "https://trusted-origin2.com"]
    }));
  3. 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.

zJaaal and others added 6 commits February 6, 2025 14:44
…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-code-dotcms-test
Copy link

Semgrep found 3 ssc-cee3e6d5-d7c8-4c35-9815-076aa1ebfd49 findings:

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 import.meta.url and the output format is set to cjs, umd, or iife formats, while allowing users to inject scriptless HTML elements with unsanitized name attributes

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 ssc-4e59e976-8886-47a3-9b32-abcb3212a6c1 finding:

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

@semgrep-code-dotcms-test
Copy link

Legal Risk

The following dependencies were released under a license that
has been flagged by your organization for consideration.

Recommendation

While 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

nicobytes and others added 17 commits February 6, 2025 12:33
…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
nicobytes and others added 4 commits February 6, 2025 14:38
…l-spellcheck-enhancement' of github.com:dotCMS/core into hackathon-2025-q1-feature-ai-content-assistance-autofill-spellcheck-enhancement
@rjvelazco rjvelazco changed the title feat: AI-Powered Content Assistance: Auto-Fill, Spell Check, and Content Enhancement for Contentlets feat: AI-Powered Content Assistance: Auto-Fill, Spell Check, and Content Enhancement for Contentlets [DONT MERGE] Feb 6, 2025
@rjvelazco rjvelazco closed this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants