Skip to content

Conversation

@jmjuanes
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 100 out of 176 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

src/webcomponents/file/file-delete.js:1

  • Debugger statement should be removed before merging to production code.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +297 to +305
#htmlToPlainText(html) {
if (typeof html !== "string") {
return String(html ?? "");
}
// Use DOMParser to strip HTML tags while keeping text content
const parser = new DOMParser();
const doc = parser.parseFromString(html, "text/html");
return doc.body.textContent || "";
}
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using DOMParser with unsanitized HTML could be a security concern. Consider validating or sanitizing the HTML input before parsing to prevent potential XSS attacks.

Copilot uses AI. Check for mistakes.
Comment on lines +337 to +339
// Fetch remote image and embed
try {
const imageRun = await this.#remoteUrlToImageRun(src, child);
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fetching images from remote URLs without validation could pose security risks. Consider implementing URL validation or using a whitelist of allowed domains before fetching remote images.

Suggested change
// Fetch remote image and embed
try {
const imageRun = await this.#remoteUrlToImageRun(src, child);
// Validate and fetch remote image and embed
try {
const url = new URL(src, window.location?.origin || undefined);
// Only allow http/https protocols
if (url.protocol !== "http:" && url.protocol !== "https:") {
throw new Error("Disallowed image URL protocol");
}
// Optional hostname whitelist via wordConfig.allowedImageHosts
const allowedHosts = this.wordConfig?.allowedImageHosts;
if (Array.isArray(allowedHosts) && allowedHosts.length > 0 && !allowedHosts.includes(url.hostname)) {
throw new Error("Disallowed image host");
}
const imageRun = await this.#remoteUrlToImageRun(url.toString(), child);

Copilot uses AI. Check for mistakes.
@jmjuanes jmjuanes changed the base branch from develop to TASK-7645 December 19, 2025 09:32
@jmjuanes jmjuanes marked this pull request as draft December 19, 2025 09:33
@jmjuanes jmjuanes marked this pull request as ready for review December 19, 2025 09:33
@gpveronica gpveronica self-requested a review December 19, 2025 13:22
@opencb opencb deleted a comment from imedina Dec 19, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
3.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants