Skip to content

N°9477 - improve documents output - #1066

Merged
jf-cbd merged 8 commits into
support/3.2from
issue/9477-improve-documents-output
Oct 6, 2026
Merged

jf-cbd merged 8 commits into
support/3.2from
issue/9477-improve-documents-output

Conversation

@jf-cbd

@jf-cbd jf-cbd commented Oct 5, 2026

Copy link
Copy Markdown
Member

Base information

Question Answer
Related to a SourceForge thread / Another PR / A GitHub Issue / Combodo ticket? 9477
Type of change? Enhancement

Symptom (bug) / Objective (enhancement)

Add unit test to ensure sandboxing is present, add some more default-src info, remove old code

Reproduction procedure (enhancement - if needed)

On iTop 3.2.3, create a DocumentFile, upload a picture and open it. See in the network console that the request have CSP sandboxing as well as "default-src 'none' " instruction.

Proposed solution (bug and enhancement)

Add more header details, add unit test, to avoid regression, clean code.

Checklist before requesting a review

  • If my PR is a bug fix or an enhancement, I opened an issue that got reviewed and approved by Combodo
  • I have performed a self-review of my code
  • I have tested all changes I made on an iTop instance
  • I have added a unit test, otherwise I have explained why I couldn't
  • Is the PR clear and detailed enough so anyone can understand without digging in the code?

Copilot AI balanced review requested due to automatic review settings October 5, 2026 15:07
@CombodoApplicationsAccount CombodoApplicationsAccount added the internal Work made by Combodo label Oct 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The new test uses an undefined variable and does not verify the newly added CSP directive.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Improves inline document security headers and removes obsolete XSS filtering.

Changes:

  • Adds default-src 'none' to the document CSP.
  • Removes legacy script filtering.
  • Adds a regression test for document response headers.
File Description
tests/​php-unit-tests/​unitary-tests/​pages/​AjaxRenderTest.php Tests document CSP headers.
sources/​Application/​WebPage/​DownloadPage.php Outputs document content directly.
sources/​Application/​WebPage/​AjaxPage.php Removes legacy XSS filter.
pages/​ajax.render.php Strengthens inline-document CSP.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/php-unit-tests/unitary-tests/pages/AjaxRenderTest.php Outdated
Comment thread tests/php-unit-tests/unitary-tests/pages/AjaxRenderTest.php
@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Critical risk] Changes how inline documents are sandboxed against script execution.

The PR appears safe to merge based on the changes since the previous review and the resolved prior finding.

Summary

The PR adds default-src 'none' to the inline-document sandbox policy, removes legacy script filtering from download output, and adds a sandbox-header test. Since the previous review, it has corrected the test’s undefined variable and made whitespace-only changes to download output.

Reviews (2) · Last reviewed commit: "Fix test"

Comment thread tests/php-unit-tests/unitary-tests/pages/AjaxRenderTest.php Outdated
@jf-cbd
jf-cbd requested a review from steffunky October 5, 2026 15:20
@jf-cbd
jf-cbd changed the base branch from develop to support/3.2 October 5, 2026 15:51
@Molkobain

Copy link
Copy Markdown
Member

@jf-cbd please mind to name the PR correctly, not straight out of the branch name. (Among other considerations, it won't appear in the corresponding ticket once merged) :)

@Molkobain Molkobain added this to the 3.2.4 milestone Oct 5, 2026
@jf-cbd jf-cbd changed the title Issue/9477 improve documents output N°9477 - improve documents output Oct 6, 2026
@steffunky
steffunky requested a balanced review from Copilot October 6, 2026 07:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused security-header enhancement and cleanup are consistent with the document delivery flow and covered by a regression test.

Review effort: Balanced
Findings: None

Resolved since last review (2)

@jf-cbd
jf-cbd merged commit 09574d9 into support/3.2 Oct 6, 2026
2 checks passed
@jf-cbd
jf-cbd deleted the issue/9477-improve-documents-output branch October 6, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Work made by Combodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants