KNOX-3418: Path traversal → arbitrary file write/overwrite in the Apa… - #1349
Merged
Conversation
hanicz
requested review from
bonampak,
lmccay,
moresandeep,
pzampino and
smolnar82
August 13, 2026 13:36
Test Results40 tests 40 ✅ 6s ⏱️ Results for commit 30d3ed7. ♻️ This comment has been updated with latest results. |
…che Knox Admin API
smolnar82
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…che Knox Admin API
KNOX-3418 - Path traversal → arbitrary file write/overwrite in the Apache Knox Admin API
What changes were proposed in this pull request?
PUT
/admin/api/v1/{providerconfig,descriptors,topologies}/{name}let an admin-role user write files outside the managed shared-providers/descriptors/topologies directories with an attacker-chosen name and extension (e.g. overwriting conf/gateway-site.xml).TopologiesResource— tightened the pattern to ^[\w.-]+$ (no /), madeisValidResourceNamealso reject any name containing.., removed redundantURLDecoder.decodefrom all three handlers. The name/id is already decoded at this point by JettyDefaultTopologyService— canonical-path containment guards at thewriteConfiganddeployTopologysinks.ZkRemoteConfigurationMonitorService—createProvider/createDescriptorstrip directory components viaFilenameUtils.getName()before building the znode path.Topologies marked read-only via
gateway.read.only.override.topologiesare blocked in the UI, but PUT/admin/api/v1/topologies/{id}never consulted that list — it only guarded against descriptor-generated topologies (isGenerated()), which read-only-override topologies are not.TopologiesResource.uploadTopology— before deploying, refuse if the name is ingetReadOnlyOverrideTopologyNames(),throwing 403 FORBIDDEN.New unit tests
How was this patch tested?
Tested Admin UI after the changes
Unit tests
Local admin API tests
Before
HTTP/1.1 200 OKAfter:
Integration Tests
N/A
UI changes
N/A