[PR #4760] [CLOSED] fix(native): reject NativeAOT reads beyond declared PE header extents (#4750) #6394

Closed
opened 2026-10-31 01:14:08 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4760
Author: @ahmed-husssain
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: fix/nativeaot-pe-header-extents


📝 Commits (2)

  • 3ec47ae fix(native): reject NativeAOT reads beyond declared PE header extents
  • 7011ba1 fix(native): reject header-crossing reads before section mappings

📊 Changes

2 files changed (+99 additions, -2 deletions)

View changed files

📝 src/domain/native/nativeAotPe.test.ts (+90 -0)
📝 src/domain/native/nativeAotPe.ts (+9 -2)

📄 Description

Summary

Fixes #4750 by enforcing PE header and optional header extents in NativeAOT binary parsing.

Problem and expected behavior

In src/domain/native/nativeAotPe.ts, PeImage.prototype.read bounded header reads with:

relative < this.#sizeOfHeaders && relative <= this.#bytes.length - size

---

<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4760 **Author:** [@ahmed-husssain](https://github.com/ahmed-husssain) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/nativeaot-pe-header-extents` --- ### 📝 Commits (2) - [`3ec47ae`](https://github.com/morluto/rea/commit/3ec47aeb893acf5f0e1a51c5546f4de1cfc7e0a8) fix(native): reject NativeAOT reads beyond declared PE header extents - [`7011ba1`](https://github.com/morluto/rea/commit/7011ba1ecd792f9bb9658b229e70c55f514561dc) fix(native): reject header-crossing reads before section mappings ### 📊 Changes **2 files changed** (+99 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/native/nativeAotPe.test.ts` (+90 -0) 📝 `src/domain/native/nativeAotPe.ts` (+9 -2) </details> ### 📄 Description ## Summary Fixes #4750 by enforcing PE header and optional header extents in NativeAOT binary parsing. ## Problem and expected behavior In `src/domain/native/nativeAotPe.ts`, `PeImage.prototype.read` bounded header reads with: ```ts relative < this.#sizeOfHeaders && relative <= this.#bytes.length - size --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:14:08 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6394
No description provided.