[NETCONF-369] Incorrect handling of filter namespaces Created: 11/Mar/17  Updated: 03/Nov/23

Status: Confirmed
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Robert Varga Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
is blocked by YANGTOOLS-711 XPath: provide an evaluator on top of... Confirmed
External issue ID: 7956

 Description   

Current implementation of RESTCONF filters does not handle namespaces correctly, as it performs a namespace-ignorant:

  • XPath parsing
  • XML parsing

This means that false positives may be encountered when elements differ only by namespace. Quoting https://tools.ietf.org/html/rfc8040#section-4.8.4:

 

The format of this parameter is an XPath 1.0 expression [XPath] and
 is evaluated in the following context:
o The set of namespace declarations is the set of prefix and
 namespace pairs for all supported YANG modules, where the prefix
 is the YANG module name and the namespace is as defined by the
 "namespace" statement in the YANG module.

 

But the XPath construction in AbstractQueryParams does not set a proper NamespaceContext. Fix this by supplying a proper NamespaceContext backed by the EffectiveModelContext. Once this is corrected, use UntrustedXML to parse the XML to prevent any shenanigans.



 Comments   
Comment by Viera Zelcamova [ 14/Mar/17 ]

moving to Boron SR4, plus downgrade to major (agreed with R.Varga)

Generated at Wed Feb 07 20:14:50 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.