← Back to CVE Explorer

CVE-2026-71268

Full vulnerability record from the local CVENow database.

Description

OpenPLC Runtime v3's compile_program function (webserver/openplc.py) parses directives from uploaded Structured Text (.st) program files and writes the referenced content to with no validation that file_path stays within the ./core directory. A path-validation function, validate_file_path, exists elsewhere in the codebase (webserver/credentials.py) but is never invoked from compile_program, leaving the sink unprotected.

Severity
CRITICAL
CVSS score
9.9 (v3.1)
Vulnerability status
Deferred
Source identifier
309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c
Published
2026-08-05 13:24:51.083000
Last modified
2026-10-24 15:10:00.190000
View original CVE JSON
{
  "id": "CVE-2026-71268",
  "sourceIdentifier": "309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c",
  "published": "2026-08-05T13:24:51.083",
  "lastModified": "2026-10-24T15:10:00.190",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "OpenPLC Runtime v3's compile_program function (webserver/openplc.py) parses directives from uploaded Structured Text (.st) program files and writes the referenced content to with no validation that file_path stays within the ./core directory. A path-validation function, validate_file_path, exists elsewhere in the codebase (webserver/credentials.py) but is never invoked from compile_program, leaving the sink unprotected."
    },
    {
      "lang": "es",
      "value": "La función compile_program() de OpenPLC Runtime v3 (webserver/openplc.py) analiza las directivas “(FILE:path content)” de los archivos de programa Structured Text (.st) cargados y escribe el contenido referenciado en “os.path.join(’./core’, file_path)” sin validación de que file_path permanezca dentro del directorio ./core. Un archivo .st manipulado que contiene una directiva como “(FILE:.. / .. / .. / etc/cron.d/x * * * * root [command]*)” escribe contenido controlado por el atacante en una ruta arbitraria del sistema de archivos, lo que permite la ejecución remota de código (por ejemplo, a través de cron o de las claves autorizadas de SSH). Una función de validación de rutas, validate_file_path(), existe en otra parte de la base de código (webserver/credentials.py) pero nunca se invoca desde compile_program(), dejando el ’sink’ desprotegido. OpenPLC se distribuye además con credenciales predeterminadas codificadas (openplc:openplc), lo que reduce la barrera práctica para la explotación."
    }
  ],
  "affected": [
    {
      "source": "309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c",
      "affectedData": [
        {
          "vendor": "thiagoralves",
          "product": "OpenPLC_v3",
          "defaultStatus": "unaffected",
          "programFiles": [
            "webserver/openplc.py"
          ],
          "versions": [
            {
              "version": "0",
              "lessThanOrEqual": "*",
              "versionType": "custom",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
          "baseScore": 9.9,
          "baseSeverity": "CRITICAL",
          "attackVector": "NETWORK",
          "attackComplexity": "LOW",
          "privilegesRequired": "LOW",
          "userInteraction": "NONE",
          "scope": "CHANGED",
          "confidentialityImpact": "HIGH",
          "integrityImpact": "HIGH",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 3.1,
        "impactScore": 6.0
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-08-05T15:41:39.300095Z",
          "id": "CVE-2026-71268",
          "options": [
            {
              "exploitation": "none"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "total"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-22"
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/thiagoralves/OpenPLC_v3",
      "source": "309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c"
    },
    {
      "url": "https://github.com/thiagoralves/OpenPLC_v3/blob/master/webserver/openplc.py",
      "source": "309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c"
    }
  ]
}