Bug 1474471

Summary: openscap crashes when scanning system with invalid hostname
Product: Red Hat Enterprise Linux 7 Reporter: Matus Marhefka <mmarhefk>
Component: openscapAssignee: Jan Černý <jcerny>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.4CC: matyc, mhaicman, openscap-maint, wsato
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-12 14:31:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matus Marhefka 2017-07-24 17:33:20 UTC
Description of problem:
When scanning system with invalid host name, openscap crashes.


Version-Release number of selected component (if applicable):
openscap-1.2.14-2.el7


How reproducible:
always


Steps to Reproduce:
# sysctl kernel.hostname=test_test
# cd tests/API/XCCDF/applicability
# make check
# grep -i "openscap error" -A15 test_api_xccdf_applicability.log
OpenSCAP Error: File '/tmp/test_remediate_fix_processing_ds.arf.52XmYH' line 0: Element '{http://scap.nist.gov/schema/asset-identification/1.1}hostname': [facet 'pattern'] The value 'test_test' is not accepted by the pattern '[\w\-]+(\.[\w\-]+){0,}'.
 [xccdf_session.c:587]
File '/tmp/test_remediate_fix_processing_ds.arf.52XmYH' line 0: Element '{http://scap.nist.gov/schema/asset-identification/1.1}hostname': 'test_test' is not a valid value of the atomic type '{http://scap.nist.gov/schema/asset-identification/1.1}hostname-type'.
 [xccdf_session.c:587]
Invalid ARF Result Datastream (1.1) content in /tmp/test_remediate_fix_processing_ds.arf.52XmYH. [oscap_source.c:342]
D: lt-probe_system_info: Received signal 15 from 30428 (parent) [lt-probe_system_info(30466):signal_handler(7fc12d3e1700):signal_handler.c:100:probe_signal_handler]
D: lt-probe_file: Received signal 15 from 30428 (parent) [lt-probe_file(30486):signal_handler(7ff224917700):signal_handler.c:100:probe_signal_handler]
./test_remediate_fix_processing_ds.sh: line 23: 30428 Segmentation fault      $OSCAP xccdf eval --verbose DEVEL --remediate --results $resultx --results-arf $arf $sds

Note: I removed redirection of stderr to a separate file in test_remediate_fix_processing_ds.sh file.

Comment 1 Matus Marhefka 2017-07-25 12:48:30 UTC
List of tests which are segfaulting due to this bug:

tests/API/XCCDF/applicability/test_remediate_fix_processing_ds.sh
tests/API/XCCDF/unittests/test_xccdf_results_arf_no_oval.sh
tests/API/XCCDF/unittests/test_fix_script_header.sh
tests/API/XCCDF/unittests/test_fix_arf.sh
tests/bz2/test_bz2_datastream.sh
tests/DS/test_ds.sh

Comment 2 Marek Haicman 2019-03-12 14:31:32 UTC
This issue was not selected to be included in Red Hat Enterprise Linux 7.7 because it is seen either as low or moderate impact to a small number of use-cases. The next release will be in Maintenance Support 1 Phase, which means that qualified Critical and Important Security errata advisories (RHSAs) and Urgent Priority Bug Fix errata advisories (RHBAs) may be released as they become available. We will now close this issue, but if you believe that it qualifies for the Maintenance Support 1 Phase, please re-open; otherwise, we recommend moving the request to Red Hat Enterprise Linux 8 if applicable.