You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3.5.0 introduced the following line to requirements.txt: lxml==5.3.0
Previously, the default version was 4.9.3. This is now causing issues because some of the lxml settings have changed, which broke usage of a specific XML feature: entity references.
Entity references in XML allow you to "include" other XML documents. This is extremely useful for modular TlmPacketizer based deployments. It looks like this:
<!DOCTYPEdoc [
<!ENTITYfsw_core SYSTEM "../../common/topology/core/fsw_core_packets.xml">
]>
<packetsname="packets"namespace="randomNamespace"size="3500">
<import_topology>deployment/Top/deploymentTopologyAppAi.xml</import_topology>
&fsw_core;
</packets>
This effectively imports whatever text is inside of the fsw_core_packets.xml.
This doesn't work in the 5.3.0 version of lxml, because the default XML parser has entity resolving disabled. The fix is on line 263 of fprime/Autocoders/Python/bin/tlm_packet_gen.py:
ifnotos.path.isfile(xml_filename):
raiseTlmPacketParseIOError("File %s does not exist!"%xml_filename)
fd=open(xml_filename, "r")
xml_parser=etree.XMLParser(remove_comments=True, load_dtd=True, resolve_entities=True, no_network=True) # < add load_dtd=True, resolve_entities=True, and no_network=Trueelement_tree=etree.parse(fd, parser=xml_parser)
channel_size_dict=None
I think they disabled this by default because there are some possible security vulnerabilities with network access. However, I think passing no_network=True should be enough to mitigate these.
Context / Environment
Execute fprime-util version-check and share the output.
Problem Description
3.5.0 introduced the following line to requirements.txt:
lxml==5.3.0
Previously, the default version was 4.9.3. This is now causing issues because some of the lxml settings have changed, which broke usage of a specific XML feature: entity references.
Entity references in XML allow you to "include" other XML documents. This is extremely useful for modular
TlmPacketizer
based deployments. It looks like this:This effectively imports whatever text is inside of the
fsw_core_packets.xml
.This doesn't work in the 5.3.0 version of lxml, because the default XML parser has entity resolving disabled. The fix is on line 263 of
fprime/Autocoders/Python/bin/tlm_packet_gen.py
:I think they disabled this by default because there are some possible security vulnerabilities with network access. However, I think passing
no_network=True
should be enough to mitigate these.Context / Environment
Execute
fprime-util version-check
and share the output.The text was updated successfully, but these errors were encountered: