Skip to content
代码片段 群组 项目
  • Chris Ross (ASP.NET)'s avatar
    1e1c8913
    Merged PR 21247: Fix partial chunked cookies 70242 · 1e1c8913
    Chris Ross (ASP.NET) 创作于
    # Fix partial chunked cookies
    
    MSRC # 70242: Fix exceptions and allocations when the cookie chunk count is not accurate
    
    ## Description
    
    Browsers have limits on how long cookies can be, as low as 4kb. It's common for TempData and CookieAuth to get above that limit, so cookies are split into chunks with the following format:
    
    MyCookie=chunks-3
    MyCookieC1=(Base64EncodedData)
    MyCookieC2=(Base64EncodedData)
    MyCookieC3=(Base64EncodedData)
    
    Fixes MSRC # 70242
    
    ## Customer Impact
    
    A malicious client could send `MyCookie=chunks-2147483647` without the actual cookie chunks and cause large allocations, exceptions, and excess CPU utilization on the server when it tried to read or delete that many chunks.
    
    This flaw comes from the original implementation in Microsoft.Owin, but is much worse in AspNetCore when adopted by TempData due to it automatically calling Delete if reading the cookie fails.
    
    I'll backport this to 5.0, 3.1, 2.1, and Microsoft.Owin once reviewed.
    
    ## Regression?
    
    - [ ] Yes
    - [x] No
    
    ## Risk
    
    - [ ] High
    - [ ] Medium
    - [x] Low
    
    Easy to reproduce and test.
    
    ## Verification
    
    - [x] Manual (required)
    - [x] Automated
    
    ## Packaging changes reviewed?
    
    - [ ] Yes
    - [ ] No
    - [x] N/A
    1e1c8913
    历史
    Merged PR 21247: Fix partial chunked cookies 70242
    Chris Ross (ASP.NET) 创作于
    # Fix partial chunked cookies
    
    MSRC # 70242: Fix exceptions and allocations when the cookie chunk count is not accurate
    
    ## Description
    
    Browsers have limits on how long cookies can be, as low as 4kb. It's common for TempData and CookieAuth to get above that limit, so cookies are split into chunks with the following format:
    
    MyCookie=chunks-3
    MyCookieC1=(Base64EncodedData)
    MyCookieC2=(Base64EncodedData)
    MyCookieC3=(Base64EncodedData)
    
    Fixes MSRC # 70242
    
    ## Customer Impact
    
    A malicious client could send `MyCookie=chunks-2147483647` without the actual cookie chunks and cause large allocations, exceptions, and excess CPU utilization on the server when it tried to read or delete that many chunks.
    
    This flaw comes from the original implementation in Microsoft.Owin, but is much worse in AspNetCore when adopted by TempData due to it automatically calling Delete if reading the cookie fails.
    
    I'll backport this to 5.0, 3.1, 2.1, and Microsoft.Owin once reviewed.
    
    ## Regression?
    
    - [ ] Yes
    - [x] No
    
    ## Risk
    
    - [ ] High
    - [ ] Medium
    - [x] Low
    
    Easy to reproduce and test.
    
    ## Verification
    
    - [x] Manual (required)
    - [x] Automated
    
    ## Packaging changes reviewed?
    
    - [ ] Yes
    - [ ] No
    - [x] N/A