Skip to content

fix(security): CodeQL #2063–#2075 path-injection residuals (#4577) - #4578

Merged
natechadwick merged 2 commits into
mainfrom
fix/codeql-alert-2063-path-injection
Sep 18, 2026
Merged

natechadwick merged 2 commits into
mainfrom
fix/codeql-alert-2063-path-injection

Conversation

@natechadwick-intsof

Copy link
Copy Markdown
Collaborator

Summary

Parent audit issue: #4577 ([night-issues: Security Audit - Fix Pass], base_branch: main).

Mitigates default-branch CodeQL java/path-injection residuals:

Alert File URL
#2063–#2073 ApplicationFileAdaptor.java https://github.com/intersoftdatalabs-in/percussioncms/security/code-scanning/2063
#2074–#2075 PSServerXmlObjectStore.java:835/838 https://github.com/intersoftdatalabs-in/percussioncms/security/code-scanning/2074

Disposition: ladder steps 1–4 already on main (PR #4571 / #4351): requireUnderBase / requireFileUnderRxDir, same-line // codeql[java/path-injection], model-pack ReturnValue barriers, path query-filters. This PR does not re-edit annotated sinks (re-fingerprint thrash). Adds ObjectStore store tests (exists/rename/delete under thread RxDir; traversal 400 before I/O) and documents #2074–#2075.

Step used: runtime already closed + tests + suppressions/query-filter reason; default-branch IDs dismissed as FP after this PR (playbook step 5).

Partial #4577

Test plan

  1. cd projects/sitemanage && JAVA_HOME=<JDK21> ../../mvnw clean install
  2. Confirm ApplicationFileAdaptorTest (36 tests) and module suite green.
  3. Do not re-touch // codeql[java/path-injection] sink lines.

Checklist

  • Product documentation — N/A (not product-facing: CodeQL residual tests + suppression index; no operator/UX/API change)
  • Unit / module tests — ApplicationFileAdaptorTest ObjectStore exists/rename/delete + traversal; sitemanage standalone clean install green
  • WebUI + Playwright — N/A (no WebUI product screen change)
  • Build gates — cd projects/sitemanage && ../../mvnw clean install (JAVA_HOME JDK 21): BUILD SUCCESS; Tests run: 2767, Failures: 0, Errors: 0, Skipped: 125; ApplicationFileAdaptorTest Tests run: 36, Failures: 0; no new compiler warnings from this diff
  • Cross-platform — tests use Path.of / Files / @TempDir

CodeQL PR checklist

Co-Authored by Grok Build 1.0.34 using grok-4.6 with agent night-issue-prs-security.

Add ObjectStore ApplicationFile store tests under a thread RxDir so
exists/rename/delete stay inside requireUnderBase. Document #2074–#2075
as residual of #2046–#2062. Do not re-edit annotated sinks.

Partial #4577

> Co-Authored by Grok Build 1.0.34 using grok-4.6 with agent night-issue-prs-security.
@natechadwick-intsof natechadwick-intsof added operator:grok Changes authored by Grok operator:night-issue-prs night-issue-prs workflow model:grok-4.6 Session model grok-4.6 labels Sep 18, 2026
Drop extra javadoc so CodeQL does not re-fingerprint annotated
exists/move/delete sinks (#2063–#2073).

> Co-Authored by Grok Build 1.0.34 using grok-4.6 with agent night-issue-prs-security.
@natechadwick
natechadwick merged commit e1f2058 into main Sep 18, 2026
5 of 6 checks passed
@natechadwick
natechadwick deleted the fix/codeql-alert-2063-path-injection branch September 18, 2026 19:12
natechadwick pushed a commit that referenced this pull request Sep 18, 2026
…4591)

* fix(security): CodeQL #2076-#2081 path-injection residuals (#4590)

Document the default-branch CodeQL java/path-injection residuals
#2077-#2081 (PSServerXmlObjectStore saveApplicationFile lines
730/731/741/742) and #2076 (ApplicationFileAdaptor
deleteRecursively line 1026) in suppressions.md and extend the
existing .github/codeql/codeql-config.yml query-filter reason text
to cover them.

Ladder steps 1-4 already on main (PR #4352 / #4571 / #4578):
  * requireFileUnderRxDir -> requireUnderBase(RxDir)
    (PSServerXmlObjectStore line 728)
  * resolveUnderAppRoot -> requireUnderBase(appDir, rel)
    (ApplicationFileAdaptor line 1006)
  * same-line // codeql[java/path-injection] annotations on every sink
  * path query-filter glob for both files
  * model pack ReturnValue barriers for both helpers (GHA does not load
    local packs but the documentation is required by contracts/C3)

Sinks were intentionally NOT re-edited - per playbook row 184,
re-editing already-annotated sinks re-fingerprints and reopens a new
alert ID.

Default-branch IDs dismissed as false positive (playbook step 5) after
this PR.

Tests (siblings on main, not re-edited):
  * PSServerXmlObjectStorePathInjectionTest
    .requireFileUnderRxDir_rejectsEscapeAndAcceptsChild
  * ApplicationFileAdaptorTest.deleteRecursively_removesTreeUnderTempDir
    (plus ObjectStore exists/rename/delete under thread RxDir from
    PR #4578)

Partial #4590

Co-Authored-By: OpenCode <noreply@opencode.ai>

* chore(review): erlang pre-merge review for #4591

Durable review record (per AGENTS.md "Erlang review" section). Recommends
approve on the docs/config diff; no bug findings; no rule-file changes.

Refs #4591

---------

Co-authored-by: OpenCode <noreply@opencode.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model:grok-4.6 Session model grok-4.6 operator:grok Changes authored by Grok operator:night-issue-prs night-issue-prs workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants