Windows Animated Cursor Stack Overflow Vulnerability

Windows 11 HiDPI光标模糊终极解决方案:Capitaine Cursors深度适配指南 在HiDPI高分辨率显示环境下,图形用户界面的清晰度是影响用户体验的关键因素之一。其核心原理在于操作系统如何对UI元素进行缩放渲染。传统的图像拉伸和插值算法在放大低分辨率资源时,不可避免地会损失边缘锐度,导致视觉上的模糊和锯齿感,这在光标、图标等需要精确定位的元素上尤为明显。为解决此问题,多分辨率资源预渲染技术应运而生,它通过为不同缩放比例预先提供对应尺寸的优化图像,让系统直接调用原生资源,从而在技术层面实现了像素级精准显示,极大提升了视觉清晰度和操作舒适度。这一技术对于设计师、程序员等需要长时间进行精细操 阅读详情
 

Windows Animated Cursor Stack Overflow Vulnerability

CVE id: CVE-2007-0038

Vendor notification: Dec 20, 2006
Public disclosure: Mar 28, 2007
Determina advisory: Mar 31, 2007
Vendor patch: Apr 3, 2007

Systems Affected:

  • Windows NT
  • Windows 2000
  • Windows XP
  • Windows 2003
  • Windows Vista

Overview:

Determina Security Research has discovered a vulnerability in the USER32.DLL code responsible for loading animated cursor (.ANI) files. This vulnerability can be exploited by a malicious web page or HTML email message and results in remote code execution with the privileges of the logged-in user. The vulnerable code is present in all versions of Windows up to and including Windows Vista. All applications that use the standard Windows API for loading cursors and icons are affected. This includes Windows Explorer, Internet Explorer, Mozilla Firefox, Outlook and others.

Microsoft fixed a closely related vulnerability with the MS05-002 security update, but their fix was incomplete. Determina Security Research was able to bypass the MS05-002 patch and develop a proof-of-concept exploit that works on fully-patched Windows systems.

Technical Details:

The ANI file format is used for storing animated cursors. The format is based on the RIFF multimedia file format and consists of a series of tagged chunks containing variable sized data. Each chunk starts with a 4 byte ASCII tag, followed by a dword specifying the size of the data contained in the chunk.

struct ANIChunk
{
    char  tag[4];        // ASCII tag
    DWORD size;          // length of data in bytes
    char  data[size];    // variable sized data
}

One of the chunks in an ANI file is the anih chunk, which contains a 36-byte animation header structure. The buffer overflow fixed in MS05-002 was in the LoadCursorIconFromFileMap function. The vulnerable code did not validate the length of the anih chunk before reading the chunk data into fixed size buffer on the stack. The pseudocode of the vulnerable function is given below:

int LoadCursorIconFromFileMap(struct MappedFile* file, ...)
{
    struct ANIChunk  chunk;
    struct ANIHeader header;        // 36 byte structure

    ...

    // read the first 8 bytes of the chunk
    ReadTag(file, &chunk);

    if (chunk.tag == 'anih') {

+       if (chunk.size != 36)       // added in MS05-002
+           return 0;

        // read chunk.size bytes of data into the header struct
        ReadChunk(file, &chunk, &header);

For more information about the MS05-002 vulnerability, please refer to the eEye advisory that describes the issue in great detail.

If the animation header is valid, LoadCursorIconFromFileMap will call the LoadAniIcon function to process the rest of the chunks in the ANI file. LoadAniIcon uses the same ReadTag and ReadChunk functions as LoadCursorIconFromFileMap and contains the same vulnerability in the code that reads the anih header. This vulnerability was left unpatched in the MS05-002 security update.

int LoadAniIcon(struct MappedFile* file, ...)
{
    struct ANIChunk  chunk;
    struct ANIHeader header;        // 36 byte structure

    ...

    while (1) {
        // read the first 8 bytes of the chunk
        ReadTag(file, &chunk);
        
        switch (chunk.tag) {
            case 'seq ':
                ...
                
            case 'LIST':
                ...
                
            case 'rate':
                ...

            case 'anih':
                // read chunk.size bytes of data into the header struct
                ReadChunk(file, &chunk, &header);

 

This code relies on the check in LoadCursorIconFromFileMap to catch the malformed anih chunk before it reaches the LoadAniIcon function. Unfortunately, LoadCursorIconFromFileMap validates only the first anih chunk, but LoadAniIcon processes all chunks in the file. By creating a file with two anih chunks, one valid and one malformed, it is possible to reach the vulnerable code in LoadAniIcon.

Reading the second anih chunk with the ReadChunk function will result in a classic buffer overflow, overwriting the return address of LoadAniChunk and allowing the attacker to take control of the code execution.

Proof of Concept:

The following .ANI file will trigger the vulnerability when the folder containing it is opened in Windows Explorer:

00000000   52 49 46 46  90 00 00 00  41 43 4F 4E  61 6E 69 68   RIFF....ACONanih
00000010   24 00 00 00  24 00 00 00  02 00 00 00  00 00 00 00   $...$...........
00000020   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
00000030   00 00 00 00  01 00 00 00  61 6E 69 68  58 00 00 00   ........anihX...
00000040   41 41 41 41  41 41 41 41  41 41 41 41  41 41 41 41   AAAAAAAAAAAAAAAA
00000050   41 41 41 41  41 41 41 41  41 41 41 41  41 41 41 41   AAAAAAAAAAAAAAAA
00000060   00 41 41 41  41 41 41 41  41 41 41 41  41 41 41 41   .AAAAAAAAAAAAAAA
00000070   41 41 41 41  41 41 41 41  41 41 41 41  00 00 00 00   AAAAAAAAAAAA....
00000080   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
00000090   42 42 42 42  43 43 43 43                             BBBBCCCC

Exploitation:

The exploitation of this vulnerability is interesting in light of the protection features built in the latest versions of Windows XP, 2003 and Vista. It is a stack overflow and should be detected by the /GS security check. Unfortunately, the Visual Studio compiler adds the /GS check only to functions that contain certain types of arrays, assuming that most buffer overflows are a result of out-of-bounds array access. The LoadAniIcon function uses a structure as a destination buffer for the data it reads and as a result its return address is not protected by the /GS stack check. This allows an attacker to overwrite the return address and take control of the program execution on Windows XP SP2, 2003 and Vista in the same way as on Windows 2000.

In addition to the missing /GS check, the vulnerable code in USER32.DLL is wrapped in an exception handler that can recover from access violations. If the exploit is unsuccessful, for example due to the Vista ASLR, the process will not terminate and the attacker can simply try again. This gives the attacker an easy way to bypass the ASLR protection and increase the reliability of the exploit.

Solution:

The call to ReadChunk in the LoadAniIcon function should be preceeded by a check similar to the one introduced in MS05-002:

if (chunk.size != 36)
    return 0;

ReadChunk(file, &chunk, &header);

Credit:

Discovery: Alexander Sotirov, Determina Security Research

41|DeepSeek Harness 侧栏拿到的是绝对路径,为什么目录接口返回相对路径? 为什么 Harness 侧栏文件行是绝对路径,目录接口返回的却是相对路径?用真实客户端组件和本地目录方法复现,覆盖混合斜杠、中文、空格和百分号。 阅读详情

相关推荐

好看的Windows11概念版鼠标指针

非常好看的指针!

微软Windows 11 Build更新了解一下:金丝雀频道的小步快跑更新

微软今日为Windows Insider项目中的Canary Channel(金丝雀频道)用户推送了Windows 11 Build 26227版本,这次更新虽然没有带来革命性的新功能,但一系列细节改进和修复,让用户日常体验更加顺畅。新增的表情包括左右摇头、上下摇头,还有神秘的凤凰、清新的青橙、棕色蘑菇,以及寓意丰富的断开的锁链等,让表达更加丰富多彩。在这次更新中,Copilot协作模式得到了微妙却实用的改进。在账户设置中,新增了一个“链接设备”的页面,对于使用微软账户登录的用户来说,这可是一个小惊喜。

qq_40427481的博客 552

三套鼠标指针方案(Oxy-Neon等).zip

用于更换windows的鼠标指针,给自己的电脑鼠标图标进行个性化升级。具体更换方法很简单,可以查看本人博客:https://blog.csdn.net/shao_yc/article/details/105593266

【免费下载】 好看的Windows 11概念版鼠标指针

好看的Windows 11概念版鼠标指针 【下载地址】好看的Windows11概念版鼠标指针 欢迎使用这款精美的Windows 11概念版鼠标指针资源!本资源专为追求个性化和视觉享受的Windows用户设计。这组鼠标指针集合灵感源自Windows 11的新时代美学,将现代与简约风格完美融合,为您的操作系统带来耳目一新的交...

gitblog_09791的博客 7504

告别裸机SPI!用HAL库和CubeMX重新玩转STM32与MAX6675温度传感器

本文详细介绍了如何利用STM32CubeMX和HAL库高效驱动MAX6675温度传感器,实现稳定可靠的热电偶温度监测系统。通过图形化配置SPI接口和封装专用驱动函数,开发者可以快速构建嵌入式温度测量方案,适用于工业控制、物联网设备等多种应用场景。

weixin_42525632的博客 239

各种AI的调试日记——辅助工作篇

记录使用各种AI(语言大模型)的心得和总结

m0_73056986的博客 1395

Web Service 的工作原理

Web Service基本概念 Web Service也叫XML Web Service WebService是一种可以接收从Internet或者Intranet上的其它系统中传递过来的请求,轻量级的独立的通讯技术。是:通过SOAP在Web上提供的软件服务,使用WSDL文件进行说明,并通过UDDI进行注册。 XML:(Extensible Markup Language)扩展型可标记语言。面向...

weixin_30478757的博客 79

深入探索前端调试神器vConsole

vConsole作为一款前端调试神器,为前端开发者提供了一个便捷的调试解决方案。通过本文的介绍和示例,相信你已经对vConsole有了更深入的了解。然而,vConsole的功能远不止于此,它还有许多高级用法和技巧等待你去发掘。讨论:你在前端开发中是如何使用vConsole的?你有没有发现vConsole的一些隐藏功能或技巧?欢迎在评论区分享你的经验和见解!💝💝💝欢迎来到我的博客,很高兴能够在这里和您见面!

一个做过前端开发的产品经理,经历过睿智产品的折磨导致脱发之后,励志要翻身"农奴"把歌唱,一边打入敌人内部一边持续提升自己,为我们广大开发同胞谋福祉,坚决抵制睿智产品折磨我们码农兄弟! 8536

Windows11 cursor speed change

如何修改(编辑选中复制文字时的)光标指针速度?文字 編集 カーソル速度。

做更好的自己 1708

how2heap 深入学习(1)

how2heap glibc 2.23学习

CoLin的pwn小屋 3185

关于海康MVS软件显示速率低与1GB、相机丢包的设置优化

工控机主要应用与视觉检测!相机网线及工控机网口都是千兆的!设置完巨帧数和速度与双工(选择为全双工),显示速度低与1GB,不能够正常工作。C.LA-Properdes-Advanced-将RecerveBuffers更改为2048。E.LAN-属性-电源管理-取消选中允许计算机关闭此设备以保存电源。这种情况均为MVS设置不熟悉,可参照如下设置优化相应端口相机配置。D.局域网-属性-高级-将传输缓冲区更改为20484。B.LAN-属性-高级-将中断记录部分更改为执行。A.关闭采集控制帧速率控制。

米可的博客! 8848

如何设置win11鼠标指针,win11怎么改鼠标指针

很多小伙伴都迫不及待地升级了win11,进入系统中,咱们发现win11的改动还是比较大的,任务栏居中,开始菜单经过重装的设计等等。比如,有些用户不知道如何设置win11鼠标指针,找了好久都找不到设置入口。关于,win11怎么改鼠标指针的这个问题,现在就已经解决了。不过,win11系统相比之前的系统做了很大的改动,界面多处采用了全新的设计,所以这就有可能会导致一些用户使用不习惯。1、win+i打开系统设置,点击“蓝牙和设备”,选择“鼠标”。4、在鼠标属性窗口,点击“指针”。5、设置想要的鼠标指针即可。

2301_79263402的博客 3460

WEB浏览器视频流播放方案

基于Media Source Extensions播放视频流 浏览器播放视频的几种方法 一、H5 video标签 在浏览器播放视频,可以使用HTML5原生的video标签。但其播放的格式使用一定限制的,目前video只支持三种格式WebM、Ogg、MP4。 WebM:WebM 文件使用 VP8 视频编解码器和 Vorbis 音频编解码器 Ogg :Ogg 文件使用 Theora 视频编解码器和 Vorbis音频编解码器 MP4: MPEG 4文件使用 H264 视频编解码器和AAC音频编解码器 上面三种

machh的专栏 2396

Windows 11 变成 macOS 风格

Windows 11 变成 macOS 风格

缘友一世的博客 3万+

分布式协作方案:OpenClaw多节点部署与设备互联

主从架构或对等架构服务发现与注册机制负载均衡策略选择分布式任务队列优先级调度失败重试机制WebSocket实时通信数据同步引擎冲突解决策略健康检查机制故障自动转移数据复制与恢复通过分布式部署,OpenClaw可以支撑更大规模的业务场景,提供更稳定可靠的AI助手服务。在下一篇文章中,我们将深入探讨安全与权限管理的精细化策略。

gaoxiang_120的专栏 375

YOLOv8【第一章:基础入门篇·第1节】一文搞定,核心架构深度解析与环境配置!

🏆 本文收录于 《YOLOv8实战:从入门到深度优化》 专栏,该专栏专注于分享我在YOLOv8目标检测模型中的实战经验,涵盖从入门基础到深度优化的全方位解决方案。无论你是计算机视觉的新手,还是具有多年深度学习经验的专家,本专栏都将为你提供高效、可复现的技术方案,助你掌握YOLOv8的核心技术,提升目标检测性能,突破瓶颈,优化模型,并加速项目开发🚀!

**My Coding Family** 2112

MS Windows Animated Cursor (.ANI) Local Overflow Exploit

/* .ANI exploit tested on Windows XP SP2 - Portuguese Shellcode port bind 13579 JMP ESP Addr - ntdll.dll Greetz: Marsu, Devcode, Str0ke, Dave

827

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

Invalid icon file 原因

引自MSDN:http://msdn.microsoft.com/en-us/library/h9y3s0bh(VS.71).aspx The icon specified in the AddRemoveProgramsIcon property for the selected deployment project is not a valid icon file. The icon mus...

weixin_33724059的博客 909

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

Buffer-Overflow Vulnerability Lab——山东大学网络攻防实验

实验给出了一个有缓冲区溢出漏洞的程序stack.c,它会从文件中读取数据,并拷贝至自己的缓冲区。我们需要利用这个漏洞获得root权限,通过精心设计exploit.c 攻击程序,使其利用用户程序的漏洞产生badfile 文件,从而使用户程序读取badfile 时,被攻击者控制。 此外,我们将接触在Linux中实施的几种保护方案,并评估其有效性。

我有一颗五角星 1万+

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

metasploit-学习8--显示exploit的模块的所有exploit信息

Name                                             Disclosure Date  Rank    Description    ----                                             ---------------  ----    -----------    aix/rpc_cmsd_opcod

简单就是美 2万+

Windows光标形状

::SetCursor( LoadCursor(NULL,IDC_XXX) ); IDC_ARROW (plain) IDC_HELP (arrow + question mark) IDC_APPSTARTING (arrow + egg timer) IDC_SIZENWISE IDC_IBEAM IDC_SIZEALL IDC_SIZEWE IDC_CROSS IDC_SIZENESW ...

weixin_30824599的博客 219

渗透攻击基础

Metasploit框架中包涵数百个模块,没有人能用脑子把它们的名字全部记下来。在MSF终端中运行show命令会把所有的模块显示出来,也可以指定模块的类型来缩小搜索范围。 1. msf > show exploits Exploits ======== Name ...

weixin_30834019的博客 5288

Vue开发篇之组件通信与表单:点了任务行,谁来更新列表

用四个Vue组件完成任务录入与状态切换,跟踪props、事件转发和表单草稿的归属。

code2cat的博客 281

AI 答案漂移检测:嵌入相似度、阈值标定与告警实现

做 GEO 监测的人迟早会遇到一个尴尬:上周还在报告里写「这个问句已经稳定被引用」,这周客户自己一问,答案换了个品牌。问题不在监测方法,而在多数监测系统只存「有没有提到」,不存「答案长什么样」。这篇写我们这套漂移检测模块的实现,目标是回答一个问题:同一个问句,今天的答案和两周前相比,变了多少,这个变化是正常抖动还是异常。

helloworld19920的博客 189

import cn.hutool.core.collection.CollUtil常用库介绍一下

在平时的 Java 开发中,只要涉及到集合的判空、去重、求交集/差集、List 转 Map 等操作,都可以优先看看。

qq_26889291的博客 241

Argument list too long:参数撞上的那堵墙

通配符是个很好用的语法糖,但它不是免费的:展开发生在命令执行之前,所有文件名都要在内核那里过一次安检。文件名里可能包含空格、换行甚至引号,用默认的换行分隔会把一个文件拆成好几个参数,反而制造新的麻烦。分隔的,管道出来变成了换行,统计口径不完全一致,但它足够帮你发现“环境是不是异常膨胀了”。里 128 KB 的缓冲区,就是它给自己留的安全余量——它宁可多跑几趟,也不愿意踩到。)的四分之一来算这个上限,同时设了一个下限,算出来的结果通常就是 2 MB 左右。目录里的日志文件不算大,几百兆而已,磁盘也还有空间。

IMPYLH的博客 254
上一篇: NTFS文件系统
下一篇: 重装TCP/IP协议
iiprogram
博客等级 码龄25年 1068粉丝 1515原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址