<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>16520</bug_id>
          
          <creation_ts>2026-11-16 04:19:33 +0000</creation_ts>
          <short_desc>layerindex: a NUL byte in a search or URL gives 500 on PostgreSQL</short_desc>
          <delta_ts>2026-11-16 04:45:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Layer Index</product>
          <component>Layer Index</component>
          <version>6.1</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Orling">tim.orling</reporter>
          <assigned_to name="Tim Orling">tim.orling</assigned_to>
          
          
          <qa_contact name="apoorv sangal">apoorvsangal</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>107496</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2026-11-16 04:19:33 +0000</bug_when>
    <thetext>PostgreSQL text can&apos;t hold a NUL byte, so a query that compares a column with a string containing one raises DataError and gives a 500:

    /layerindex/branch/master/recipes/?q=%00
    /layerindex/api/recipes/?filter=pn:%00
    /rrs/recipes/%00/6.2/M1/
    DataError: PostgreSQL text fields cannot contain NUL (0x00) bytes

MariaDB accepts these and returns no results. This needs fixing before the move to PostgreSQL (bug 16476): reject or strip NUL in search terms and path values before they reach the database (e.g. Django&apos;s ProhibitNullCharactersValidator on the search forms, or one middleware returning 400). Found by fuzz testing a bench instance running PostgreSQL 17.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>