{"id":"CVE-2026-53503","aliases":["CVE-2026-53503","GHSA-cqjp-jf4r-h5q9","PYSEC-2026-3619"],"related":[],"kind":"vulnerability","state":"published","title":"Thumbor convolution filter allows divide-by-zero in C extension leading to remote DoS","summary":"Thumbor is an open-source photo thumbnail service by globo.com. Prior to 7.8.0, Thumbor's filters:convolution(<matrix>, <columns>, <should_normalize>) filter passes the user-controlled <columns> value to a C extension (thumbor/ext/filters/_convolution.c) where it is used as a divisor (for % and /) without validating columns > 0. When columns=0, the C code triggers undefined behavior; on x86_64 this reliably results in a fatal divide-by-zero trap (SIGFPE) and crashes the Thumbor process, causing a remote denial of service. This issue is fixed in 7.8.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Thumbor is an open-source photo thumbnail service by globo.com. Prior to 7.8.0, Thumbor's filters:convolution(<matrix>, <columns>, <should_normalize>) filter passes the user-controlled <columns> value to a C extension (thumbor/ext/filters/_convolution.c) where it is used as a divisor (for % and /) without validating columns > 0. When columns=0, the C code triggers undefined behavior; on x86_64 this reliably results in a fatal divide-by-zero trap (SIGFPE) and crashes the Thumbor process, causing a remote denial of service. This issue is fixed in 7.8.0.","source":"cvelist"},{"lang":"en","text":"### Summary\nThumbor's `filters:convolution(<matrix>, <columns>, <should_normalize>)` filter passes the user-controlled `<columns>` value to a C extension (`thumbor/ext/filters/_convolution.c`) where it is used as a divisor (for `%` and `/`) without validating `columns > 0`. When `columns=0`, the C code triggers undefined behavior; on x86_64 this reliably results in a fatal divide-by-zero trap (SIGFPE) and crashes the Thumbor process (confirmed on Linux x86_64 and macOS Intel x86_64), causing a remote denial of service.\n\n### Details\n#### Root cause\nThe Python filter accepts `columns=0`, and the native C extension uses `columns_count` as a divisor without validating it.\n\n1) Python filter entry point allows `columns=0` (`thumbor/filters/convolution.py`):\n```python\n@filter_method(\n    r\"(?:[-]?[\\d]+\\.?[\\d]*[;])*(?:[-]?[\\d]+\\.?[\\d]*)\",\n    BaseFilter.PositiveNumber,  # accepts 0\n    BaseFilter.Boolean,\n)\nasync def convolution(self, matrix, columns, should_normalize=True):\n    ...\n    imgdata = _convolution.apply(..., matrix, columns, should_normalize)\n```\n`BaseFilter.PositiveNumber` matches `\"0\"` (`thumbor/filters/__init__.py`):\n```python\nclass BaseFilter:\n    PositiveNumber = {\"regex\": r\"[\\d]+\", \"parse\": int}  # matches \"0\"\n    PositiveNonZeroNumber = {\"regex\": r\"[\\d]*[1-9][\\d]*\", \"parse\": int}\n```\n\n2) C extension divides/modulos by `columns_count` without a zero check (`thumbor/ext/filters/_convolution.c`):\n```c\nkernel_size = PyTuple_Size(kernel_tuple);\nif ((kernel_size % columns_count != 0) ||\n    (kernel_size % 2 == 0) ||\n    ((kernel_size / columns_count) % 2) == 0) {\n    // TODO: error, not a valid kernel\n    return NULL;\n}\n```\n\n\n### PoC\n#### Test environment\n- Linux x86_64\n\n#### Preconditions\n- The `convolution` filter is enabled (it is enabled by default via `BUILTIN_FILTERS`).\n- Either:\n  - `/unsafe/` URLs are allowed (`ALLOW_UNSAFE_URL=True`), OR\n  - `/unsafe/` is disabled, and the attacker has a valid signed URL (i.e., the attacker is an authorized user/partner, or can obtain signed URLs from a trusted signing service).\n\n#### Example request (signed URL)\n`http://<host>:<port>/<url-sign>/400x400/filters:convolution(1;2;1;2;4;2;1;2;1,0,true)/example.jpg`\n\n#### Example request (/unsafe/)\n`http://<host>:<port>/unsafe/400x400/filters:convolution(1;2;1;2;4;2;1;2;1,0,true)/example.jpg`\n\n\n### Impact\n- Remote Denial of Service via process crash (SIGFPE) on x86_64 (confirmed on Linux x86_64 and macOS Intel x86_64).\n- Exploitability depends on deployment:\n  - If `/unsafe/` is enabled: unauthenticated remote DoS.\n  - If `/unsafe/` is disabled: the attacker needs a valid signed URL.(i.e., the attacker is an authorized user/partner, or can obtain signed URLs from a trusted signing service)\n\n\n### Suggested remediation\n- In the C extension (`thumbor/ext/filters/_convolution.c`):\n  - Reject `columns_count <= 0` before any `%` or `/`.\n- In the Python filter (`thumbor/filters/convolution.py`):\n  - Require `columns` to be non-zero (e.g., use `BaseFilter.PositiveNonZeroNumber`).","format":"markdown","source":"ghsa"}],"published":"2026-07-31T18:54:20.747Z","modified":"2026-09-08T20:51:43.490Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-20","CWE-369"],"affected":[{"ranges":[{"version":"< 7.8.0","status":"affected"}],"vendor":"thumbor","product":"thumbor","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"7.8.0"}],"ecosystem":"PyPI","package":"thumbor","purl":"pkg:pypi/thumbor","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"7.8.0"}],"ecosystem":"PyPI","package":"thumbor","purl":"pkg:pypi/thumbor","source":"pysec"}],"references":[{"url":"https://github.com/thumbor/thumbor/security/advisories/GHSA-cqjp-jf4r-h5q9","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/thumbor/thumbor/commit/447e192e3fb92e64c12e5354a56a4a7133f69d73","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/thumbor/thumbor/releases/tag/7.8.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/thumbor/thumbor","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/thumbor","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-cqjp-jf4r-h5q9","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53503","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-07-31T20:14:06.472Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-53503","url":"https://www.cve.org/CVERecord?id=CVE-2026-53503","licence":"CVE Terms of Use","modified":"2026-07-31T21:39:35.108Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cqjp-jf4r-h5q9","url":"https://github.com/advisories/GHSA-cqjp-jf4r-h5q9","licence":"CC-BY-4.0","modified":"2026-08-04T14:41:06.639Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-53503","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-53503","licence":"Public domain","modified":"2026-09-08T20:51:43.490Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3619","url":"https://osv.dev/vulnerability/PYSEC-2026-3619","licence":"CC-BY-4.0","modified":"2026-08-04T14:30:17.900Z"}],"updatedAt":"2026-11-25T22:59:30.733Z","epss":{"score":0.00493,"percentile":0.43941,"date":"2026-12-01T12:00:22.000Z"}}