Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ansible-core-2.18 for 
openSUSE:Factory checked in at 2026-11-26 15:54:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ansible-core-2.18 (Old)
 and      /work/SRC/openSUSE:Factory/.ansible-core-2.18.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ansible-core-2.18"

Thu Nov 26 15:54:40 2026 rev:14 rq:1400708 version:2.18.20

Changes:
--------
--- /work/SRC/openSUSE:Factory/ansible-core-2.18/ansible-core-2.18.changes      
2026-11-06 20:01:05.344044421 +0100
+++ 
/work/SRC/openSUSE:Factory/.ansible-core-2.18.new.1340718/ansible-core-2.18.changes
 2026-11-26 15:55:50.367937508 +0100
@@ -1,0 +2,17 @@
+Fri Nov 13 09:53:45 UTC 2026 - Harshvardhan Sharma 
<[email protected]>
+
+- Security fix for CVE-2026-84503 (bsc#1289577): the git module built
+  its git commands as strings, so values taken from the repository or
+  the task (remote, branch, ref and submodule names) were split again
+  on whitespace and could reach git as extra arguments. Pass every
+  command to run_command as an argument list instead.
+  Backport of gh#ansible/ansible#87762 (commit 5186cff1).
+  * add ansible-core-CVE-2026-84503.patch
+- Security fix for CVE-2026-105929 (bsc#1289573): ansible-galaxy role
+  install accepted a role name that resolves outside the configured
+  roles directory, so a requirements file could make it create or
+  replace a directory elsewhere. Such a name is now an error.
+  Backport of gh#ansible/ansible#87749 (commit 9795c1b5).
+  * add ansible-core-CVE-2026-105929.patch
+
+-------------------------------------------------------------------

New:
----
  ansible-core-CVE-2026-105929.patch
  ansible-core-CVE-2026-84503.patch

----------(New B)----------
  New:  Backport of gh#ansible/ansible#87749 (commit 9795c1b5).
  * add ansible-core-CVE-2026-105929.patch
  New:  Backport of gh#ansible/ansible#87762 (commit 5186cff1).
  * add ansible-core-CVE-2026-84503.patch
- Security fix for CVE-2026-105929 (bsc#1289573): ansible-galaxy role
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ansible-core-2.18.spec ++++++
--- /var/tmp/diff_new_pack.XHBTax/_old  2026-11-26 15:55:51.243974621 +0100
+++ /var/tmp/diff_new_pack.XHBTax/_new  2026-11-26 15:55:51.244974663 +0100
@@ -63,6 +63,10 @@
 Patch4:         ansible-core-CVE-2026-16493.patch
 # CVE-2026-89091 (bsc#1284847)
 Patch5:         ansible-core-CVE-2026-89091.patch
+# PATCH-FIX-UPSTREAM ansible-core-CVE-2026-84503.patch bsc#1289577 
CVE-2026-84503 -- gh#ansible/ansible#87762
+Patch6:         ansible-core-CVE-2026-84503.patch
+# PATCH-FIX-UPSTREAM ansible-core-CVE-2026-105929.patch bsc#1289573 
CVE-2026-105929 -- gh#ansible/ansible#87749
+Patch7:         ansible-core-CVE-2026-105929.patch
 BuildArch:      noarch
 
 Provides:       ansible-core = %{version}

++++++ ansible-core-CVE-2026-105929.patch ++++++
>From 9795c1b56a67138e807404d97b3e4b4d33098614 Mon Sep 17 00:00:00 2001
From: Brian Coca <[email protected]>
Date: Mon, 26 Oct 2026 16:52:15 -0400
Subject: [PATCH] ansible-galaxy - Validate the role name  (#87749)

* Validate the role name before creating or modifying the installation path

Fixes CVE-2026-105929
Simplify by making any unsafe role name an error instead of guarding against 
modifying/installing it

* handle possible diff error messages

Co-authored-by: Sloane Hertel <[email protected]>

Upstream fix gh#ansible/ansible#87749, released in 2.19.15 and 2.20.11.
This is the upstream commit applied to 2.18 (bsc#1289573).

Differences from the upstream commit:
- changelog fragment dropped (not shipped in the sdist)
- integration test additions dropped (the integration target is not run
  in the package build)
The lib/ansible/cli/galaxy.py change is taken verbatim.
---
 lib/ansible/cli/galaxy.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py
index 17c923209d..995a2580f1 100755
--- a/lib/ansible/cli/galaxy.py
+++ b/lib/ansible/cli/galaxy.py
@@ -59,6 +59,7 @@ from ansible.playbook.role.requirement import RoleRequirement
 from ansible.template import Templar
 from ansible.utils.collection_loader import AnsibleCollectionConfig
 from ansible.utils.display import Display
+from ansible.utils.path import is_subpath
 from ansible.utils.plugin_docs import get_versioned_doclink
 from ansible.utils.vars import load_extra_vars
 
@@ -1464,6 +1465,15 @@ class GalaxyCLI(CLI):
 
             display.vvv('Processing role %s ' % role.name)
 
+            if not any(
+                is_subpath(os.path.join(path, role.name), path, real=True)
+                for path in context.CLIARGS['roles_path']
+            ):
+                display.warning(f"The role name '{role.name}' resolves to a 
path outside of the configured role directory")
+                self.exit_without_ignore()
+                display.display(f'- skipping role {role.name}')
+                continue
+
             # query the galaxy API for the role data
 
             if role.install_info is not None:

++++++ ansible-core-CVE-2026-84503.patch ++++++
>From 5186cff137018276877e2e6c24e669ec46098d2a Mon Sep 17 00:00:00 2001
From: Brian Coca <[email protected]>
Date: Tue, 27 Oct 2026 11:49:14 -0400
Subject: [PATCH] git module - run_command cleanup (#87762)

CVE-2026-84503

Upstream fix gh#ansible/ansible#87762, released in 2.19.15 (#87766) and
2.20.11 (#87765). This is the upstream commit applied to 2.18
(bsc#1289577).

Differences from the upstream commit, all because the code does not exist
in 2.18:
- changelog fragment dropped (not shipped in the sdist)
- submodules_fetch(): no get_submodule_branch()/version_ref hunk
- switch_version(): 2.18 has no "merge --ff-only" branch, so the
  "reset --hard" command is built in one statement
All other changed lines are taken verbatim from the upstream commit.
---
 lib/ansible/modules/git.py | 94 ++++++++++++++++++-------------------
 1 file changed, 49 insertions(+), 45 deletions(-)

diff --git a/lib/ansible/modules/git.py b/lib/ansible/modules/git.py
index c9ccff4..eddb6ee 100644
--- a/lib/ansible/modules/git.py
+++ b/lib/ansible/modules/git.py
@@ -381,14 +381,14 @@ def head_splitter(headfile, remote, module=None, 
fail_on_error=False):
                 module.fail_json(msg="Unable to read %s" % headfile)
         if rawdata:
             try:
-                rawdata = rawdata.replace('refs/remotes/%s' % remote, '', 1)
+                rawdata = rawdata.replace(f'refs/remotes/{remote}', '', 1)
                 refparts = rawdata.split(' ')
                 newref = refparts[-1]
                 nrefparts = newref.split('/', 2)
                 res = nrefparts[-1].rstrip('\n')
             except Exception:
                 if fail_on_error and module:
-                    module.fail_json(msg="Unable to split head from '%s'" % 
rawdata)
+                    module.fail_json(msg=f"Unable to split head from 
'{rawdata}'")
     return res
 
 
@@ -408,7 +408,7 @@ def get_submodule_update_params(module, git_path, cwd):
     params = []
 
     # run a bad submodule command to get valid params
-    cmd = "%s submodule update --help" % (git_path)
+    cmd = [git_path, 'submodule', 'update', '--help']
     rc, stdout, stderr = module.run_command(cmd, cwd=cwd)
     lines = stderr.split('\n')
     update_line = None
@@ -521,7 +521,7 @@ def set_git_ssh_env(key_file, ssh_opts, git_version, 
module):
 def get_version(module, git_path, dest, ref="HEAD"):
     ''' samples the version of the git repo '''
 
-    cmd = "%s rev-parse %s" % (git_path, ref)
+    cmd = [git_path, "rev-parse", ref]
     rc, stdout, stderr = module.run_command(cmd, cwd=dest)
     sha = to_native(stdout).rstrip('\n')
     return sha
@@ -619,7 +619,7 @@ def clone(git_path, module, repo, dest, remote, depth, 
version, bare,
             # git before 1.7.5 doesn't have separate-git-dir argument, do 
fallback
             needs_separate_git_dir_fallback = True
         else:
-            cmd.append('--separate-git-dir=%s' % separate_git_dir)
+            cmd.append(f'--separate-git-dir={separate_git_dir}')
 
     cmd.extend([repo, dest])
     module.run_command(cmd, check_rc=True, cwd=dest_dirname)
@@ -644,7 +644,7 @@ def has_local_mods(module, git_path, dest, bare):
     if bare:
         return False
 
-    cmd = "%s status --porcelain" % (git_path)
+    cmd = [git_path, "status", "--porcelain"]
     rc, stdout, stderr = module.run_command(cmd, cwd=dest)
     lines = stdout.splitlines()
     lines = list(filter(lambda c: not re.search('^\\?\\?.*$', c), lines))
@@ -658,7 +658,7 @@ def reset(git_path, module, dest):
     Discards any changes to tracked files in working
     tree since that commit.
     '''
-    cmd = "%s reset --hard HEAD" % (git_path,)
+    cmd = [git_path, "reset", "--hard", "HEAD"]
     return module.run_command(cmd, check_rc=True, cwd=dest)
 
 
@@ -670,7 +670,7 @@ def get_diff(module, git_path, dest, repo, remote, depth, 
bare, before, after):
         # Ensure we have the object we are referring to during git diff !
         git_version_used = git_version(git_path, module)
         fetch(git_path, module, repo, dest, after, remote, depth, bare, '', 
git_version_used)
-        cmd = '%s diff %s %s' % (git_path, before, after)
+        cmd = [git_path, 'diff', before, after]
         (rc, out, err) = module.run_command(cmd, cwd=dest)
         if rc == 0 and out:
             return {'prepared': out}
@@ -687,6 +687,7 @@ def get_remote_head(git_path, module, dest, version, 
remote, bare):
     cloning = False
     cwd = None
     tag = False
+    cmd = [git_path, 'ls-remote', remote]
     if remote == module.params['repo']:
         cloning = True
     elif remote == 'file://' + os.path.expanduser(module.params['repo']):
@@ -696,15 +697,15 @@ def get_remote_head(git_path, module, dest, version, 
remote, bare):
     if version == 'HEAD':
         if cloning:
             # cloning the repo, just get the remote's HEAD version
-            cmd = '%s ls-remote %s -h HEAD' % (git_path, remote)
+            cmd.extend(['-h', 'HEAD'])
         else:
             head_branch = get_head_branch(git_path, module, dest, remote, bare)
-            cmd = '%s ls-remote %s -h refs/heads/%s' % (git_path, remote, 
head_branch)
+            cmd.extend(['-h', '--', shlex.quote(f'refs/heads/{head_branch}')])
     elif is_remote_branch(git_path, module, dest, remote, version):
-        cmd = '%s ls-remote %s -h refs/heads/%s' % (git_path, remote, version)
+        cmd.extend(['-h', f'refs/heads/{version}'])
     elif is_remote_tag(git_path, module, dest, remote, version):
         tag = True
-        cmd = '%s ls-remote %s -t refs/tags/%s*' % (git_path, remote, version)
+        cmd.extend(['-t', f'refs/tags/{version}*'])
     else:
         # appears to be a sha1.  return as-is since it appears
         # cannot check for a specific sha1 on remote
@@ -729,7 +730,7 @@ def get_remote_head(git_path, module, dest, version, 
remote, bare):
 
 
 def is_remote_tag(git_path, module, dest, remote, version):
-    cmd = '%s ls-remote %s -t refs/tags/%s' % (git_path, remote, version)
+    cmd = [git_path, 'ls-remote', remote, '-t', f'refs/tags/{version}']
     (rc, out, err) = module.run_command(cmd, check_rc=True, cwd=dest)
     if to_native(version, errors='surrogate_or_strict') in out:
         return True
@@ -739,10 +740,10 @@ def is_remote_tag(git_path, module, dest, remote, 
version):
 
 def get_branches(git_path, module, dest):
     branches = []
-    cmd = '%s branch --no-color -a' % (git_path,)
+    cmd = [git_path, 'branch', '--no-color', '-a']
     (rc, out, err) = module.run_command(cmd, cwd=dest)
     if rc != 0:
-        module.fail_json(msg="Could not determine branch data - received %s" % 
out, stdout=out, stderr=err)
+        module.fail_json(msg=f"Could not determine branch data - received 
{out}", stdout=out, stderr=err)
     for line in out.split('\n'):
         if line.strip():
             branches.append(line.strip())
@@ -754,7 +755,7 @@ def get_annotated_tags(git_path, module, dest):
     cmd = [git_path, 'for-each-ref', 'refs/tags/', '--format', 
'%(objecttype):%(refname:short)']
     (rc, out, err) = module.run_command(cmd, cwd=dest)
     if rc != 0:
-        module.fail_json(msg="Could not determine tag data - received %s" % 
out, stdout=out, stderr=err)
+        module.fail_json(msg=f"Could not determine tag data - received {out}", 
stdout=out, stderr=err)
     for line in to_native(out).split('\n'):
         if line.strip():
             tagtype, tagname = line.strip().split(':')
@@ -764,7 +765,7 @@ def get_annotated_tags(git_path, module, dest):
 
 
 def is_remote_branch(git_path, module, dest, remote, version):
-    cmd = '%s ls-remote %s -h refs/heads/%s' % (git_path, remote, version)
+    cmd = [git_path, 'ls-remote', remote, '-h', f'refs/heads/{version}']
     (rc, out, err) = module.run_command(cmd, check_rc=True, cwd=dest)
     if to_native(version, errors='surrogate_or_strict') in out:
         return True
@@ -774,13 +775,7 @@ def is_remote_branch(git_path, module, dest, remote, 
version):
 
 def is_local_branch(git_path, module, dest, branch):
     branches = get_branches(git_path, module, dest)
-    lbranch = '%s' % branch
-    if lbranch in branches:
-        return True
-    elif '* %s' % branch in branches:
-        return True
-    else:
-        return False
+    return f'{branch}' in branches or f'* {branch}' in branches
 
 
 def is_not_a_branch(git_path, module, dest):
@@ -841,6 +836,11 @@ def get_head_branch(git_path, module, dest, remote, 
bare=False):
     if is_not_a_branch(git_path, module, dest):
         headfile = os.path.join(repo_path, 'refs', 'remotes', remote, 'HEAD')
     branch = head_splitter(headfile, remote, module=module, fail_on_error=True)
+
+    if branch.startswith('-'):
+        # prevent branch names that can be confused as options
+        module.fail_json(msg=f'Invalid branch name ({branch}) from {headfile} 
in {remote}')
+
     return branch
 
 
@@ -1010,48 +1010,52 @@ def set_remote_branch(git_path, module, dest, remote, 
version, depth):
     Can't use git remote set-branches, as it is not available in git 1.7.1 
(centos6)
     """
 
-    branchref = "+refs/heads/%s:refs/heads/%s" % (version, version)
-    branchref += ' +refs/heads/%s:refs/remotes/%s/%s' % (version, remote, 
version)
-    cmd = "%s fetch --depth=%s %s %s" % (git_path, depth, remote, branchref)
+    cmd = [
+        git_path,
+        "fetch",
+        f"--depth={depth}",
+        remote,
+        f"+refs/heads/{version}:refs/heads/{version}",
+        f"+refs/heads/{version}:refs/remotes/{remote}/{version}",
+    ]
     (rc, out, err) = module.run_command(cmd, cwd=dest)
     if rc != 0:
-        module.fail_json(msg="Failed to fetch branch from remote: %s" % 
version, stdout=out, stderr=err, rc=rc)
+        module.fail_json(msg=f"Failed to fetch branch from remote: {version}", 
stdout=out, stderr=err, rc=rc)
 
 
 def switch_version(git_path, module, dest, remote, version, verify_commit, 
depth, gpg_allowlist):
     cmd = ''
     if version == 'HEAD':
         branch = get_head_branch(git_path, module, dest, remote)
-        (rc, out, err) = module.run_command("%s checkout --force %s" % 
(git_path, branch), cwd=dest)
+        (rc, out, err) = module.run_command([git_path, "checkout", "--force", 
branch], cwd=dest)
         if rc != 0:
-            module.fail_json(msg="Failed to checkout branch %s" % branch,
-                             stdout=out, stderr=err, rc=rc)
-        cmd = "%s reset --hard %s/%s --" % (git_path, remote, branch)
+            module.fail_json(msg=f"Failed to checkout branch {branch} HEAD", 
stdout=out, stderr=err, rc=rc)
+        cmd = [git_path, "reset", "--hard", shlex.quote("/".join([remote, 
branch]))]
     else:
         # FIXME check for local_branch first, should have been fetched already
         if is_remote_branch(git_path, module, dest, remote, version):
+            rv = "/".join([remote, version])
             if depth and not is_local_branch(git_path, module, dest, version):
                 # git clone --depth implies --single-branch, which makes
                 # the checkout fail if the version changes
                 # fetch the remote branch, to be able to check it out next
                 set_remote_branch(git_path, module, dest, remote, version, 
depth)
             if not is_local_branch(git_path, module, dest, version):
-                cmd = "%s checkout --track -b %s %s/%s" % (git_path, version, 
remote, version)
+                cmd = [git_path, "checkout", "--track", "-b", version, rv]
             else:
-                (rc, out, err) = module.run_command("%s checkout --force %s" % 
(git_path, version), cwd=dest)
+                (rc, out, err) = module.run_command([git_path, "checkout", 
"--force", version], cwd=dest)
                 if rc != 0:
-                    module.fail_json(msg="Failed to checkout branch %s" % 
version, stdout=out, stderr=err, rc=rc)
-                cmd = "%s reset --hard %s/%s" % (git_path, remote, version)
+                    module.fail_json(msg=f"Failed to checkout branch version 
{version}", stdout=out, stderr=err, rc=rc)
+                cmd = [git_path, "reset", "--hard", rv]
         else:
-            cmd = "%s checkout --force %s" % (git_path, version)
+            cmd = [git_path, "checkout", "--force", version]
     (rc, out1, err1) = module.run_command(cmd, cwd=dest)
     if rc != 0:
-        if version != 'HEAD':
-            module.fail_json(msg="Failed to checkout %s" % (version),
-                             stdout=out1, stderr=err1, rc=rc, cmd=cmd)
+        if version == 'HEAD':
+            msg = f"Failed to checkout branch {branch}"
         else:
-            module.fail_json(msg="Failed to checkout branch %s" % (branch),
-                             stdout=out1, stderr=err1, rc=rc, cmd=cmd)
+            msg = f"Failed to checkout {version}"
+        module.fail_json(msg=msg, stdout=out1, stderr=err1, rc=rc, cmd=cmd)
 
     if verify_commit:
         verify_commit_sign(git_path, module, dest, version, gpg_allowlist)
@@ -1064,9 +1068,9 @@ def verify_commit_sign(git_path, module, dest, version, 
gpg_allowlist):
         git_sub = "verify-tag"
     else:
         git_sub = "verify-commit"
-    cmd = "%s %s %s" % (git_path, git_sub, version)
+    cmd = [git_path, git_sub, version]
     if gpg_allowlist:
-        cmd += " --raw"
+        cmd.append("--raw")
     (rc, out, err) = module.run_command(cmd, cwd=dest)
     if rc != 0:
         module.fail_json(msg='Failed to verify GPG signature of commit/tag 
"%s"' % version, stdout=out, stderr=err, rc=rc)
@@ -1095,7 +1099,7 @@ def get_gpg_fingerprint(output):
 
 def git_version(git_path, module):
     """return the installed version of git"""
-    cmd = "%s --version" % git_path
+    cmd = [git_path, "--version"]
     (rc, out, err) = module.run_command(cmd)
     if rc != 0:
         # one could fail_json here, but the version info is not that important,

Reply via email to