CVE-2011-0469 (published 2017-08-17T16:29Z)

Code injection in openSUSE when running some source services used in the open build service 2.1 before March 11 2011.

Severity: HIGH
CVSS v2 base score: 9.0 (AV:N/AC:L/Au:N/C:P/I:C/A:P)
CVSS v3 base score: 9.8, CRITICAL (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)

Weakness information:
cwe_id: CWE-94
cwe_name: Improper Control of Generation of Code ('Code Injection')
description: The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
extended_description: 
            When a product allows a user's input to contain code syntax, it might be possible for an attacker to craft the code in such a way that it will alter the intended control flow of the product. Such an alteration could lead to arbitrary code execution.
            Injection problems encompass a wide variety of issues -- all mitigated in very different ways. For this reason, the most effective way to discuss these weaknesses is to note the distinct features which classify them as injection weaknesses. The most important issue to note is that all injection problems share one thing in common -- i.e., they allow for the injection of control plane data into the user-controlled data plane. This means that the execution of the process may be altered by sending code in through legitimate data channels, using no other mechanism. While buffer overflows, and many other flaws, involve the use of some further issue to gain execution, injection problems need only for the data to be parsed. The most classic instantiations of this category of weakness are SQL injection and format string vulnerabilities.
         
         

Fix information:
repo_url: https://github.com/openSUSE/open-build-service
commit_details: repo_url: https://github.com/openSUSE/open-build-service
author: Adrian Schröter
author_date: 2011-03-14 11:27:26+01:00
msg: [backend] verify file names return by source service (do not allow files with new lines #679151)
repository: repo_url: https://github.com/openSUSE/open-build-service
repo_name: openSUSE/open-build-service
description: Build and distribute Linux packages from sources in an automatic, consistent and reproducible way #obs
repo_language: Ruby
owner: openSUSE
file_changes: filename: bs_srcserver
change_type: ModificationType.MODIFY
diff: @@ -203,6 +203,7 @@ sub runservice {
 	unlink($lockfile);
 	die("ERROR: bs_service returned a non-_service file\n");
       }
+      BSVerify::verify_filename($pfile);
       $files->{$pfile} = addfile($projid, $packid, "$odir/$pfile", $pfile);
     }
   } else {

programming_language: Perl
repo_url: https://github.com/openSUSE/open-build-service
commit_details: repo_url: https://github.com/openSUSE/open-build-service
author: Adrian Schröter
author_date: 2011-03-11 14:11:59+01:00
msg: [backend] fix argument handling in lxc command execution
repository: repo_url: https://github.com/openSUSE/open-build-service
repo_name: openSUSE/open-build-service
description: Build and distribute Linux packages from sources in an automatic, consistent and reproducible way #obs
repo_language: Ruby
owner: openSUSE
file_changes: filename: call-service-in-lxc.sh
change_type: ModificationType.MODIFY
diff: @@ -31,23 +31,21 @@ mount --bind "$PWD" "$MOUNTDIR/$INNERSRCDIR/"
 echo "#!/bin/bash" > "$MOUNTDIR/$INNERSCRIPT"
 echo "cd $INNERSRCDIR" >> "$MOUNTDIR/$INNERSCRIPT"
 
-MODE=""
-WITH_NET=""
-COMMAND=""
+WITH_NET="0"
+COMMAND="$1"
+shift
+case "$COMMAND" in
+  */download_url|*/tar_scm|*/download_src_package|*/update_source|*/download_files)
+    WITH_NET="1"
+    ;;
+esac
 
 while [ $# -gt 0 ]; do
   if [ "$1" == "--outdir" ] ; then
      shift
      OUTDIR="$1"
   else
-     COMMAND="$COMMAND \"${1/\"/_}\" "
-     if [ -z "$MODE" ]; then
-        case "$1" in
-          */download_url|*/tar_scm|*/download_src_package|*/update_source|*/download_files)
-            WITH_NET="1"
-            ;;
-        esac
-     fi
+     COMMAND="$COMMAND '${1//\'/_}'"
   fi
   shift
 done
@@ -63,12 +61,13 @@ chown -R $RUNUSER "$MOUNTDIR/$INNEROUTDIR"
 #if [ "$WITH_NET" == "1" ] ; then
 #  echo "rcnscd start" >> "$MOUNTDIR/$INNERSCRIPT"
 #fi
-echo -n "su $RUNUSER -c '" >> "$MOUNTDIR/$INNERSCRIPT"
-echo "$COMMAND --outdir $INNEROUTDIR'" >> "$MOUNTDIR/$INNERSCRIPT"
-chmod 0755 "$MOUNTDIR/$INNERSCRIPT"
+echo -n "su $RUNUSER -s ${INNERSCRIPT}.command" >> "$MOUNTDIR/$INNERSCRIPT"
+echo "#!/bin/bash"               >  "$MOUNTDIR/${INNERSCRIPT}.command"
+echo "${COMMAND[@]} --outdir $OUTDIR" >> "$MOUNTDIR/${INNERSCRIPT}.command"
+chmod 0755 "$MOUNTDIR/$INNERSCRIPT" "$MOUNTDIR/${INNERSCRIPT}.command"
 
 # construct jail
-LXC_CONF="/tmp/obs.service.$$"
+LXC_CONF="/obs.service.$$"
 echo "lxc.utsname = obs.service.$$" > $LXC_CONF
 if [ "$WITH_NET" == "1" ] ; then
   mount -t proc proc $MOUNTDIR/proc

programming_language: Shell