Commit 8f27403
authored
Merge pull request from GHSA-gpxc-v2m8-fr3x
* beh backend: Use execv() instead of system() - CVE-2023-24805
With execv() command line arguments are passed as separate strings and
not the full command line in a single string. This prevents arbitrary
command execution by escaping the quoting of the arguments in a job
with forged job title.
* beh backend: Extra checks against odd/forged input - CVE-2023-24805
- Do not allow '/' in the scheme of the URI (= backend executable
name), to assure that only backends inside /usr/lib/cups/backend/
are used.
- Pre-define scheme buffer to empty string, to be defined for case of
uri being NULL.
- URI must have ':', to split off scheme, otherwise error.
- Check return value of snprintf() to create call path for backend, to
error out on truncation of a too long scheme or on complete failure
due to a completely odd scheme.
* beh backend: Further improvements - CVE-2023-24805
- Use strncat() instead of strncpy() for getting scheme from URI, the latter
does not require setting terminating zero byte in case of truncation.
- Also exclude "." or ".." as scheme, as directories are not valid CUPS
backends.
- Do not use fprintf() in sigterm_handler(), to not interfere with a
fprintf() which could be running in the main process when
sigterm_handler() is triggered.
- Use "static volatile int" for global variable job_canceled.1 parent a4809b8 commit 8f27403
1 file changed
+84
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
| 241 | + | |
240 | 242 | | |
241 | 243 | | |
242 | | - | |
243 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
244 | 251 | | |
245 | 252 | | |
246 | 253 | | |
247 | 254 | | |
248 | 255 | | |
249 | | - | |
250 | | - | |
251 | | - | |
| 256 | + | |
| 257 | + | |
252 | 258 | | |
253 | 259 | | |
254 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
255 | 279 | | |
256 | 280 | | |
257 | 281 | | |
| |||
261 | 285 | | |
262 | 286 | | |
263 | 287 | | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
274 | 307 | | |
275 | 308 | | |
276 | 309 | | |
| |||
279 | 312 | | |
280 | 313 | | |
281 | 314 | | |
282 | | - | |
283 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
284 | 320 | | |
285 | 321 | | |
286 | 322 | | |
287 | 323 | | |
288 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
289 | 327 | | |
290 | | - | |
291 | | - | |
292 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
293 | 350 | | |
294 | 351 | | |
295 | 352 | | |
| |||
304 | 361 | | |
305 | 362 | | |
306 | 363 | | |
307 | | - | |
308 | | - | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
309 | 368 | | |
310 | 369 | | |
311 | 370 | | |
| |||
0 commit comments