Skip to content

Bug 623644 & 620646: [Subcontracting] Fix security issues and remove unused code#7859

Merged
ChethanT merged 4 commits intomainfrom
bugs/Subcontracting/623644-FixSecurityIssues
Apr 28, 2026
Merged

Bug 623644 & 620646: [Subcontracting] Fix security issues and remove unused code#7859
ChethanT merged 4 commits intomainfrom
bugs/Subcontracting/623644-FixSecurityIssues

Conversation

@ChethanT
Copy link
Copy Markdown
Contributor

@ChethanT ChethanT commented Apr 27, 2026

Summary

  • Bug 623644: Security fixes — removed overly broad legacy permission set (SubcPermissionset) that granted unrestricted tabledata access and was publicly assignable; sanitized error message in GetSubcontractor() that exposed vendor and work center numbers
  • Bug 620646: Removed unused/unwanted code — deleted redundant page customizations (SubcProdOrderComponents, SubcRoutingLines), removed unused Do Not Validate field from Transfer Header table extension, removed duplicate Routing Link Code visibility override from Routing Lines page extension, and updated Subcontracting Manager profile to remove references to the deleted customizations

Test plan

  • Compile and publish the Subcontracting app without errors
  • Verify the Subcontracting Manager profile loads without errors (no dangling customization references)
  • Confirm Routing Link Code and Location Code visibility on Prod. Order Components and Routing Lines pages is not regressed
  • Verify subcontracting purchase order flow works end-to-end (GetSubcontractor error path shows generic message)
  • Confirm SubcontractEdit and SubcontractRead permission sets remain functional via D365 BUS FULL ACCESS extension

🤖 Generated with Claude Code

Fixes AB#623644 & AB#620646

ChethanT and others added 2 commits April 27, 2026 13:26
- Remove unused 'Do Not Validate' field from Transfer Header table extension
- Delete redundant page customizations for Prod. Order Components and Routing Lines
- Remove duplicate Routing Link Code visibility override from Routing Lines page extension
- Update Subcontracting Manager profile to remove references to deleted customizations

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copilot AI review requested due to automatic review settings April 27, 2026 11:59
@ChethanT ChethanT requested a review from a team as a code owner April 27, 2026 11:59
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Apr 27, 2026
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

AL Documentation Audit

Documentation gaps were detected in the following apps:

  • Subcontracting: 36% documentation coverage

To generate documentation, run /al-docs init or /al-docs update using GitHub Copilot CLI or Claude Code.
This review is for awareness to help keep documentation in sync with code changes. It is okay to dismiss this request.

Copy link
Copy Markdown
Contributor

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.

Pull request overview

This PR addresses two subcontracting bugs by tightening security around permissions and user-facing errors, and by removing unused profile customizations/fields to reduce maintenance surface in the Subcontracting app.

Changes:

  • Removes a legacy, overly broad, publicly assignable permission set and deletes unused page customizations and a redundant pageextension layout override.
  • Removes an unused field from the Subcontracting Transfer Header table extension and updates the Subcontracting Manager profile to avoid dangling customization references.
  • Adjusts the error label text used when a work center’s subcontractor vendor record cannot be found.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Apps/W1/Subcontracting/App/src/Profiles/SubcontractingManager.Profile.al Drops deleted customizations from the Subcontracting Manager profile.
src/Apps/W1/Subcontracting/App/src/Profiles/SubcRoutingLines.PageCust.al Removes an unused page customization for Routing Lines.
src/Apps/W1/Subcontracting/App/src/Profiles/SubcProdOrderComponents.PageCust.al Removes an unused page customization for Prod. Order Components.
src/Apps/W1/Subcontracting/App/src/Process/Tableextensions/Transfer/SubcTransferHeader.TableExt.al Removes the unused “Do Not Validate” field from the Transfer Header extension.
src/Apps/W1/Subcontracting/App/src/Process/Pageextensions/Manufacturing/SubcRoutingLines.PageExt.al Removes a redundant UI visibility override for “Routing Link Code”.
src/Apps/W1/Subcontracting/App/src/Process/Codeunits/SubcontractingManagement.Codeunit.al Updates the missing-vendor error label text in GetSubcontractor().
src/Apps/W1/Subcontracting/App/src/Permissions/SubcPermissionset.PermissionSet.al Deletes the legacy permission set object.

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

@alexei-dobriansky
Copy link
Copy Markdown
Contributor

Analysis

Scope vs. claim mismatch. The PR is titled and framed as a security fix for AB#623644 plus dead-code cleanup for AB#620646. The actual changes are all defensible cleanup, but the "security" framing of two of them is overstated:

  1. The WorkCenterVendorDoesntExistErr label change in SubcontractingManagement.Codeunit.al:172 is described as "sanitized error message... that exposed vendor and work center numbers". The final state of the PR (after the iteration with the AI reviewer and the revert in a7a79c8) is 'Subcontractor %1 on Work Center %2 does not exist.' — i.e. the parameterized form with both numbers still rendered. The only differences from the previous label are: (a) word "Vendor" → "Subcontractor", (b) corrected Comment metadata. This is a wording/metadata correctness fix, not a sanitization fix. AB#623644 itself is tagged SecurityRating: Not A Security Issue and the [AI-REPRO] note says "This is a code review finding, not a runtime security vulnerability."
  2. AB#623644 is referenced in the body as AB#623544 — a typo.

Permissionset deletion (Subc. Permissionset, 99001500). Replacement (Subcontract. - Edit/Read/Objs) covers the same surface and is wired into D365 BUS FULL ACCESS / D365 READ. Functionally clean. Concern: Subc. Permissionset is Assignable = true. Direct git rm of an assignable permissionset without an [Obsolete] step is a breaking change for any tenant that has it assigned. Standard BC pattern is ObsoleteState = Pending + ObsoleteTag for at least one major version before removal. PR does not document why obsoletion is being skipped.

Field deletion "Do Not Validate" (99001554). No references anywhere; field is DataClassification = SystemMetadata, Editable = false. Same obsoletion concern as above — table-extension schema change without ObsoleteState = Pending + ObsoleteTag skips the supported upgrade pattern.

Page customization / page-extension layout removals. Verified safe:

  • Routing Lines (99000765) declares Routing Link Code with no Visible = false → default visible. Removing the redundant modify and the page customization does not regress visibility.
  • Prod. Order Components declares both Routing Link Code and Location Code without Visible = false → removing SubcProdOrderComponents.PageCust.al is safe.
  • Trimmed SubcontractingManager.Profile.al references Subc. ProdOrderRouting and Subc. ReleasedProdOrderLines — both exist.

Test coverage. None added. Acceptable for pure removals, but a single profile-load + permissionset-coverage assertion would harden the cleanup.

Recommendation: Accept with Suggestions

  1. Fix PR description. AB#623544AB#623644. Reword the "sanitized error message" bullet — the final label still renders both numbers; the change is wording + Comment correction.
  2. Document the obsoletion strategy for Subc. Permissionset (99001500). Either state that the Subcontracting BCApps module has not GA-shipped before v29.0 so direct removal is safe, or use [Obsolete] Pending first and remove later.
  3. Same obsoletion question for the Do Not Validate field (99001554) on Subc. Transfer Header.
  4. Optional: add a profile-load / permissionset-coverage test covering (a) the Subcontracting Manager profile resolves all its Customizations; (b) D365 BUS FULL ACCESS - Subcontracting grants RIMD on Subc. Management Setup and Subcontractor Price.
  5. Consider re-titling away from "security issues" — the linked bug is explicitly tagged "Not A Security Issue."

None of these are blockers; code-level changes are safe per verification. The asks are about PR description accuracy and AL obsoletion convention.

@ChethanT ChethanT enabled auto-merge (squash) April 28, 2026 20:49
@ChethanT ChethanT merged commit 6640172 into main Apr 28, 2026
86 of 89 checks passed
@ChethanT ChethanT deleted the bugs/Subcontracting/623644-FixSecurityIssues branch April 28, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants