hitoshura25/cvefixes huggingface dataset:
CVE-2020-7791 (C#, published 2020-12-11T17:15Z)
Description: value: This affects the package i18n before 2.1.15. Vulnerability arises out of insufficient handling of erroneous language tags in src/i18n/Concrete/TextLocalizer.cs and src/i18n/LocalizedApplication.cs.
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: NVD-CWE-noinfo \u2014 Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Repository: https://github.com/turquoiseowl/i18n
Files changed:
src/i18n/Concrete/TextLocalizer.cs
src/i18n/LocalizedApplication.cs
Commit message: FIX - NullReferenceException caused by bad langtag #387


Vulnerable code:
                DefaultLanguageTag = LanguageTag.GetCachedInstance(value);
        public LanguageTag DefaultLanguageTag { get; set; }

Fixed code:
            if (!langtag.IsSet()) {
                return false; }

                LanguageTag defaultLanguageTag = LanguageTag.GetCachedInstance(value);
                if (defaultLanguageTag != null) {
                    DefaultLanguageTag = defaultLanguageTag; }
        public LanguageTag DefaultLanguageTag { get; private set; }
CVE-2023-32698 (Unknown, published 2023-05-30T04:15Z)
Description: value: nFPM is an alternative to fpm. The file permissions on the checked-in files were not maintained. Hence, when nfpm packaged 
the files (without extra config for enforcing it’s own permissions) files could go out with bad permissions (chmod 666 or 777). Anyone using nfpm for creating packages without checking/setting file permissions before packaging could result in bad permissions for files/folders.
Severity: nan (CVSS v3 base score: 7.1)
Weakness: CWE-276 \u2014 Incorrect Default Permissions
During installation, installed file permissions are set to allow anyone to modify those files.
Repository: https://github.com/goreleaser/nfpm
Files changed:
Commit message: sec: fix for CVE-2023-32698

This commit merely documents all commits related to fixing
CVE-2023-32698, as they were a bit spread.

It also has the intent of showing up properly in our changelog.

Here's the commit list:

* 8e517cca1704e5af68769e9401e51ea139022f9c
* f64a311eefea340cd3f20cd4568de41b4c5e9aa6
* 66c3d277cfee061b2ec3b2a31c15a1f879b8539d

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>


Vulnerable code:

Fixed code:
CVE-2018-13797 (Unknown, published 2018-07-10T12:29Z)
Description: value: The macaddress module before 0.2.9 for Node.js is prone to an arbitrary command injection flaw, due to allowing unsanitized input to an exec (rather than execFile) call.
Severity: HIGH (CVSS v3 base score: 9.8)
Weakness: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
Repository: https://github.com/scravy/node-macaddress
Files changed:
Commit message: Merge pull request #20 from flypapertech/fixCommandInjection

Fixes arbitrary command injection by using execFile instead of exec

Vulnerable code:

Fixed code:
CVE-2020-35149 (JavaScript, published 2020-12-11T19:15Z)
Description: value: lib/utils.js in mquery before 3.2.3 allows a pollution attack because a special property (e.g., __proto__) can be copied during a merge or clone operation.
Severity: MEDIUM (CVSS v3 base score: 5.3)
Weakness: NVD-CWE-noinfo \u2014 Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Repository: https://github.com/aheckmann/mquery
Files changed:
lib/utils.js
test/utils.test.js
Commit message: fix(utils): avoid copying special properties like `__proto__` when merging and cloning


Vulnerable code:

Fixed code:
var specialProperties = ['__proto__', 'constructor', 'prototype'];

    // Not technically prototype pollution because this wouldn't merge properties
    // onto `Object.prototype`, but avoid properties like __proto__ as a precaution.
    if (specialProperties.indexOf(k) !== -1) {
      continue;
    }

    if (specialProperties.indexOf(key) !== -1) {
      continue;
    }

    it('skips __proto__', function() {
      var payload = JSON.parse('{"__proto__": {"polluted": "vulnerable"}}');
      var res = utils.clone(payload);

      assert.strictEqual({}.polluted, void 0);
      assert.strictEqual(res.__proto__, Object.prototype);
    });
  });

  describe('merge', function() {
    it('avoids prototype pollution', function() {
      var payload = JSON.parse('{"__proto__": {"polluted": "vulnerable"}}');
      var obj = {};
      utils.merge(obj, payload);

      assert.strictEqual({}.polluted, void 0);
    });
CVE-2020-5259 (JavaScript, published 2020-03-10T18:15Z)
Description: value: In affected versions of dojox (NPM package), the jqMix method is vulnerable to Prototype Pollution. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. This has been patched in versions 1.11.10, 1.12.8, 1.13.7, 1.14.6, 1.15.3 and 1.16.2
Severity: MEDIUM (CVSS v3 base score: 8.6)
Weakness: CWE-74 \u2014 Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
Repository: https://github.com/dojo/dojox
Files changed:
jq.js
Commit message: Merge pull request from GHSA-3hw5-q855-g6cw

Prevent the special __proto__ property name from being mixed in to
prevent polluting the prototoype of the object being mixed into in the
jqMix function in jq.js

Vulnerable code:
			if((tobj[x] === undefined || tobj[x] != props[x]) && props[x] !== undefined && obj != props[x]){

Fixed code:
			if(x !== '__proto__ ' && ((tobj[x] === undefined || tobj[x] != props[x])) && props[x] !== undefined && obj != props[x]){
CVE-2021-28117 (C++, published 2021-03-20T21:15Z)
Description: value: libdiscover/backends/KNSBackend/KNSResource.cpp in KDE Discover before 5.21.3 automatically creates links to potentially dangerous URLs (that are neither https:// nor http://) based on the content of the store.kde.org web site. (5.18.7 is also a fixed version.)
Severity: MEDIUM (CVSS v3 base score: 7.5)
Weakness: NVD-CWE-noinfo \u2014 Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Repository: https://github.com/KDE/discover
Files changed:
libdiscover/backends/KNSBackend/KNSResource.cpp
Commit message: Only turn http[s] links into clickable links

CVE-2021-28117

(cherry picked from commit d375031ff0262cedac7d6ee2b26d6a164ddebb67)


Vulnerable code:
    static const QRegularExpression urlRegExp(QStringLiteral("(^|\\s)([-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:;%_\\+.~#?&//=]*)?)"), QRegularExpression::CaseInsensitiveOption);

Fixed code:
    static const QRegularExpression urlRegExp(QStringLiteral("(^|\\s)(http[-a-zA-Z0-9@:%_\\+.~#?&//=]{2,256}\\.[a-z]{2,4}\\b(\\/[-a-zA-Z0-9@:;%_\\+.~#?&//=]*)?)"), QRegularExpression::CaseInsensitiveOption);
CVE-2023-1176 (Python, published 2023-03-24T15:15Z)
Description: value: Absolute Path Traversal in GitHub repository mlflow/mlflow prior to 2.2.2.
Severity: nan (CVSS v3 base score: 3.3)
Weakness: CWE-36 \u2014 Absolute Path Traversal
The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize absolute path sequences such as "/abs/path" that can resolve to a location that is outside of that directory.
Repository: https://github.com/mlflow/mlflow
Files changed:
mlflow/store/model_registry/file_store.py
mlflow/utils/file_utils.py
tests/store/model_registry/test_file_store.py
Commit message: Prevent registered model name from containing path separator (#7892)

Signed-off-by: harupy <hkawamura0130@gmail.com>

Vulnerable code:
    _validate_model_name,

Fixed code:
    _validate_model_name as _original_validate_model_name,
    contains_path_separator,
def _validate_model_name(name):
    _original_validate_model_name(name)
    if contains_path_separator(name):
        raise MlflowException(
            f"Invalid name: '{name}'. Registered model name cannot contain path separator",
            INVALID_PARAMETER_VALUE,
        )




def contains_path_separator(path):
    """
    Returns True if a path contains a path separator, False otherwise.
    """
    return any((sep in path) for sep in (os.path.sep, os.path.altsep) if sep is not None)
def test_create_registered_model_with_name_that_looks_like_path(store, tmp_path):
    name = str(tmp_path.joinpath("test"))
    with pytest.raises(
        MlflowException, match=r"Registered model name cannot contain path separator"
    ):
        store.get_registered_model(name)
CVE-2023-6709 (Python, published 2023-12-12T04:15Z)
Description: value: Improper Neutralization of Special Elements Used in a Template Engine in GitHub repository mlflow/mlflow prior to 2.9.2.
Severity: nan (CVSS v3 base score: 8.8)
Weakness: CWE-1336 \u2014 Improper Neutralization of Special Elements Used in a Template Engine
The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.
Repository: https://github.com/mlflow/mlflow
Files changed:
mlflow/recipes/cards/__init__.py
Commit message: Use `SandboxedEnvironment` when rendering cards (#10640)

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>

Vulnerable code:
        import jinja2
        j2_env = jinja2.Environment(loader=jinja2.BaseLoader()).from_string(self.template)

Fixed code:
        from jinja2 import BaseLoader
        from jinja2.sandbox import SandboxedEnvironment
        j2_env = SandboxedEnvironment(loader=BaseLoader()).from_string(self.template)
CVE-2023-6975 (Python, published 2023-12-20T06:15Z)
Description: value: A malicious user could use this issue to get command execution on the vulnerable machine and get access to data & models information.
Severity: nan (CVSS v3 base score: 9.8)
Weakness: CWE-29 \u2014 Path Traversal: '\..\filename'
The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.
Repository: https://github.com/mlflow/mlflow
Files changed:
mlflow/store/artifact/ftp_artifact_repo.py
tests/store/artifact/test_ftp_artifact_repo.py
Commit message: Apply `os.path.basename` before `.` or `..` check in `FTPArtifactRepository` (#10657)

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>

Vulnerable code:
            artifact_files = list(filter(lambda x: x != "." and x != "..", artifact_files))

Fixed code:
            artifact_files = list(filter(lambda x: x != "." and x != "..", artifact_files))
def test_list_artifacts_malicious_path(ftp_mock):
    artifact_root_path = "/experiment_id/run_id/"
    repo = FTPArtifactRepository("ftp://test_ftp" + artifact_root_path)
    repo.get_ftp_client = MagicMock()
    call_mock = MagicMock(return_value=ftp_mock)
    repo.get_ftp_client.return_value = MagicMock(__enter__=call_mock)
    ftp_mock.nlst = MagicMock(return_value=[".", "/.", "/..", "//.."])

    artifacts = repo.list_artifacts(path=None)
    assert artifacts == []
CVE-2023-6976 (Python, published 2023-12-20T06:15Z)
Description: value: This vulnerability is capable of writing arbitrary files into arbitrary locations on the remote filesystem in the context of the server process.
Severity: nan (CVSS v3 base score: 8.8)
Weakness: CWE-434 \u2014 Unrestricted Upload of File with Dangerous Type
The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.
Repository: https://github.com/mlflow/mlflow
Files changed:
mlflow/server/handlers.py
mlflow/store/artifact/http_artifact_repo.py
mlflow/utils/uri.py
Commit message: Use validated path after path validation  (#10666)

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>

Vulnerable code:
    validate_path_is_safe(path)
        validate_path_is_safe(path)
    validate_path_is_safe(path)
    validate_path_is_safe(path)
    validate_path_is_safe(artifact_path)
    validate_path_is_safe(artifact_path)
    if request_message.HasField("path"):
        validate_path_is_safe(request_message.path)
        path = request_message.path
    else:
        path = None
    validate_path_is_safe(artifact_path)
    validate_path_is_safe(artifact_path)
    validate_path_is_safe(artifact_path)
    validate_path_is_safe(artifact_path)
            validate_path_is_safe(f["path"])
                posixpath.join(path, f["path"]) if path else f["path"],

Fixed code:
    path = validate_path_is_safe(path)
        path = validate_path_is_safe(path)
    path = validate_path_is_safe(path)
    path = validate_path_is_safe(path)
    artifact_path = validate_path_is_safe(artifact_path)
    artifact_path = validate_path_is_safe(artifact_path)
    path = validate_path_is_safe(request_message.path) if request_message.HasField("path") else None
    artifact_path = validate_path_is_safe(artifact_path)
    artifact_path = validate_path_is_safe(artifact_path)
    artifact_path = validate_path_is_safe(artifact_path)
    artifact_path = validate_path_is_safe(artifact_path)
            validated_path = validate_path_is_safe(f["path"])
                posixpath.join(path, validated_path) if path else validated_path,
    return path
CVE-2023-6977 (Python, published 2023-12-20T06:15Z)
Description: value: This vulnerability enables malicious users to read sensitive files on the server.
Severity: nan (CVSS v3 base score: 7.5)
Weakness: CWE-29 \u2014 Path Traversal: '\..\filename'
The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '\..\filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.
Repository: https://github.com/mlflow/mlflow
Files changed:
mlflow/utils/uri.py
tests/utils/test_uri.py
Commit message: Improve `is_local_uri` (#10638)

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>

Vulnerable code:
    scheme = parsed_uri.scheme
    if scheme == "" or scheme == "file":

Fixed code:
    scheme = parsed_uri.scheme
    if scheme == "":
        return True

    if scheme == "file":
    assert is_local_uri("//proc/self/root")
    assert is_local_uri("/proc/self/root")
CVE-2024-0520 (Python, published 2024-06-06T19:15Z)
Description: value: A vulnerability in mlflow/mlflow version 8.2.1 allows for remote code execution due to improper neutralization of special elements used in an OS command ('Command Injection') within the `mlflow.data.http_dataset_source.py` module. Specifically, when loading a dataset from a source URL with an HTTP scheme, the filename extracted from the `Content-Disposition` header or the URL path is used to generate the final file path without proper sanitization. This flaw enables an attacker to control the file path fully by utilizing path traversal or absolute path techniques, such as '../../tmp/poc.txt' or '/tmp/poc.txt', leading to arbitrary file write. Exploiting this vulnerability could allow a malicious user to execute commands on the vulnerable machine, potentially gaining access to data and model information. The issue is fixed in version 2.9.0.
Severity: nan (CVSS v3 base score: )
Weakness: CWE-23 \u2014 Relative Path Traversal
The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.
Repository: https://github.com/mlflow/mlflow
Files changed:
mlflow/data/http_dataset_source.py
tests/data/test_http_dataset_source.py
Commit message: Sanitize filename in Content-Disposition (#10584)

Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>

Vulnerable code:

Fixed code:
def _is_path(filename: str) -> bool:
    """
    Return True if `filename` is a path, False otherwise. For example,
    "foo/bar" is a path, but "bar" is not.
    """
    return os.path.basename(filename) != filename


            if _is_path(basename):
                raise MlflowException.invalid_parameter_value(
                    f"Invalid filename in Content-Disposition header: {basename}. "
                    "It must be a file name, not a path."
                )


@pytest.mark.parametrize(
    "filename",
    [
        "/foo/bar.txt",
        "./foo/bar.txt",
        "../foo/bar.txt",
        "foo/bar.txt",
    ],
)
def test_source_load_with_content_disposition_header_invalid_filename(filename):
    def download_with_mock_content_disposition_headers(*args, **kwargs):
        response = cloud_storage_http_request(*args, **kwargs)
        response.headers["Content-Disposition"] = f"attachment; filename={filename}"
        return response

    with mock.patch(
        "mlflow.data.http_dataset_source.cloud_storage_http_request",
        side_effect=download_with_mock_content_disposition_headers,
    ):
        source = HTTPDatasetSource(
            "https://raw.githubusercontent.com/mlflow/mlflow/master/tests/datasets/winequality-red.csv"
        )

        with pytest.raises(MlflowException, match="Invalid filename in Content-Disposition header"):
            source.load()
CVE-2017-14920 (JavaScript, published 2017-09-30T01:29Z)
Description: value: Stored XSS vulnerability in eGroupware Community Edition before 16.1.20170922 allows an unauthenticated remote attacker to inject JavaScript via the User-Agent HTTP header, which is mishandled during rendering by the application administrator.
Severity: MEDIUM (CVSS v3 base score: 6.1)
Weakness: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Repository: https://github.com/EGroupware/egroupware
Files changed:
api/js/etemplate/et2_core_baseWidget.js
api/js/jsapi/egw_tooltip.js
calendar/js/et2_widget_event.js
calendar/templates/default/conflicts.xet
Commit message: Set statustext value as text by default
- Introduce new boolean attribute called statustext_html in case we want
explicitly statustext gets rendered as html
- Fix Calendar tooltip with new statustext_html attribute

Vulnerable code:
				this.egw().tooltipBind(elem, _value);
	function prepare(_html)
		tooltip_div.append(_html);
		tooltipBind: function(_elem, _html) {
						prepare(_html);
			
				(this.options.value.location ? '<p><span class="calendar_calEventLabel">'+this.egw().lang('Location') + '</span>:' + 
		
	
						<image src="conflicts[$row][icon_participants]" statustext="@conflicts[$row][tooltip_participants]" no_lang="1"/>
						<vbox statustext="conflict[$row][tooltip]" orient=",0,0">

Fixed code:
		"statustext_html": {
			"name": "Tooltip is html",
			"type": "boolean",
			"description": "Flag to allow html content in tooltip",
			"default": false
		},
				this.egw().tooltipBind(elem, _value, this.options.statustext_html);
	 * @param {boolean} _isHtml if set to true content gets appended as html
	function prepare(_html, _isHtml)
		if (_isHtml)
		{
			tooltip_div.append(_html);
		}
		else
		{
			tooltip_div.text(_html)
		}
		tooltipBind: function(_elem, _html, _isHtml) {
						prepare(_html, _isHtml);
					event.options.statustext_html = true;

				(this.options.value.location ? '<p><span class="calendar_calEventLabel">'+this.egw().lang('Location') + '</span>:' +


						<image src="conflicts[$row][icon_participants]" statustext_html="true" statustext="@conflicts[$row][tooltip_participants]" no_lang="1"/>
						<vbox statustext="conflict[$row][tooltip]" statustext_html="true" orient=",0,0">
CVE-2023-28102 (Ruby, published 2023-03-27T22:15Z)
Description: value: discordrb is an implementation of the Discord API using Ruby. In discordrb before commit `91e13043ffa` the `encoder.rb` file unsafely constructs a shell string using the file parameter, which can potentially leave clients of discordrb vulnerable to command injection. The library is not directly exploitable: the exploit requires that some client of the library calls the vulnerable method with user input. However, if unsafe input reaches the library method, then an attacker can execute arbitrary shell commands on the host machine. Full impact will depend on the permissions of the process running the `discordrb` library and will likely not be total system access. This issue has been addressed in code, but a new release of the `discordrb` gem has not been uploaded to rubygems. This issue is also tracked as `GHSL-2022-094`.
Severity: nan (CVSS v3 base score: 9.6)
Weakness: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
Repository: https://github.com/shardlab/discordrb
Files changed:
lib/discordrb/voice/encoder.rb
Commit message: fix: switch popen to use an array invocation


Vulnerable code:
      command = "#{ffmpeg_command} -loglevel 0 -i \"#{file}\" #{options} -f s16le -ar 48000 -ac 2 #{filter_volume_argument} pipe:1"
      command = "#{ffmpeg_command} -loglevel 0 -i - #{options} -f s16le -ar 48000 -ac 2 #{filter_volume_argument} pipe:1"
    def ffmpeg_command
      @use_avconv ? 'avconv' : 'ffmpeg'

Fixed code:
      command = ffmpeg_command(input: file, options: options)
      command = ffmpeg_command(options: options)
    def ffmpeg_command(input: '-', options: null)
      [
        @use_avconv ? 'avconv' : 'ffmpeg',
        '-loglevel', '0',
        '-i', input,
        '-f', 's16le',
        '-ar', '48000',
        '-ac', '2',
        'pipe:1',
        filter_volume_argument,
      ].concat(options.split).reject {|segment| segment.nil? || segment == '' }