Two Oracles to Get One Key: A tale of recovering a symmetric key from an encrypt-only firmware update scheme
By
Gabriel Gonzalez
Can an RSA public key be recovered if it’s never published? Yes, if the system leaks whether a submitted value exceeds the modulus. That yes/no signal allows a binary search that recovers the modulus in roughly one query per key bit, and with the standard exponent of 65537, the full public key follows.
Why does recovering the public key matter? It enables a Bleichenbacher padding oracle attack against PKCS#1 v1.5, which here recovered the AES key used to encrypt the firmware.
One of the most satisfying moments in vulnerability research is when you find a way around a show-stopper and manage to fully compromise a system. This post covers a specific situation I was investigating a few years ago: a device so well-secured that its only remaining remote attack vector was the firmware update mechanism. Yet within hours, I’d recovered the full AES key the system relied on. What follows is the technique I used to do it.
It was a kind of “weird” setup. The system shipped its firmware as an encrypted binary blob. Specifically, an RSA hybrid (envelope) encrypted blob that combined an AES-encrypted payload with the corresponding AES key encrypted via public-key crypto. It carried the magic Salted__, so I knew OpenSSL was being used somewhere in the toolchain.
The manufacturer had chosen to use public/private key cryptography in an unusual way: the private key was kept inside the device, and the public key was never published, they kept it to themselves. I guess they’d probably thought this design was secure because it behaves like one that has two secret keys: one to encrypt the AES key, and the other to decrypt it.
In practice, however, the system leaked some errors through its update API, which let me discover the padding it used. I was pretty happy to see that padding was PKCS#1 v1.5, the mode that is vulnerable to a padding oracle attack. The only problem: to actually mount that attack, you need the public key. Why? Because it holds both the exponent and the modulus, which are necessary to carry out the right calculations while mounting the padding attack. Except in this case, the public key was never published.
After submitting multiple modifications of the encrypted firmware looking for edge cases, I noticed the system returned a different error when I submitted some specific malformed messages. Reproducing a similar setup offline, I worked out that it was complaining about the submitted data being too large for the modulus. But wait, what does that actually mean?
The modulus, and why it matters
An RSA public key is really just two integers, written (n, e). The exponent e is almost always 65537 (0x10001), it’s OpenSSL’s default and is also, for practical purposes, fixed. The modulus n is the product of two secret primes, n = p · q, and its bit length is the key size. Encryption itself is a single modular exponentiation:
c = m^e mod n # m = padded message, c = ciphertext
Because every operation is reduced modulo n, OpenSSL first checks that the number you submit is smaller than n. Anything equal to or larger than the modulus cannot be a valid RSA block, so it is rejected before the private-key operation with a specific error data too large for modulus error. In other words, for any value c I chose, the endpoint was telling me whether c >= n: a yes/no comparison against the one number the vendor was trying to keep secret.
Using this oracle on the update API, I came up with a simple method to recover the modulus of the key pair. And since the exponent that OpenSSL uses is known, solving for n meant I could fully reconstruct the public key.
Recovering the modulus with a binary search
The key observation is that the comparation “is c >= n?” is false for every value below the modulus, and true for everything at or above it. Therefore, the smallest value the oracle calls “too large” is the modulus itself. Using an implementation similar to the below pseudocode, I started quering the oracle with values. If the system returned an error, I would move to the lower half. If it passed the filter, I’d move to the upper half, get the middle value, and then query again. I did this until I could narrow it down to the exact byte that would return an error but the same value minus 1 would pass the filter.
lo = 2**(bits-1) # a real modulus has its top bit set
hi = 2**bits - 1
while hi - lo > 1:
mid = (lo + hi) / 2
if too_large(mid): # oracle: is mid >= n ?
hi = mid
else:
lo = mid
n = hi # the smallest 'too large' value is n itself
Figure 1. Aa binary search over the k-bit range converges on n in about k queries, one per bit.
Figure 2. Flow Diagram of the queriesused torecover the actual modulus.The flow beginswith the most significant byte and thenmovesto the next one, continuinguntil we have fully recoveredthe modulus.
The second oracle: Bleichenbacher on the padding
In the final step, we’re essentially turning the padding check into a second oracle. You submit chosen multiples of the captured ciphertext, and for each one, the endpoint tells you whether the decrypted block begins with the valid 00 02 header of a well-formed v1.5 block. Every “valid” answer confines the unknown plaintext to a narrower numeric interval; iterating the construction shrinks that interval, multiple by multiple, until a single value is left.
Note that this attack doesn’t reveal the actual private key but the plaintext it’s trying to protect. In this specific scheme, the RSA block actually wraps the AES firmware key itself. So, the plaintext Bleichenbacher recovers is not some intermediate secret, it’s the exact symmetric key I’d been after from the start.
I did not reinvent the wheel here: I simply followed Dennis Yurichev’s clear reference write-up of the attack, then adapted my implementation to match this device’s padding oracle error.
A final penetration test can miss a design choice that gives attackers an easy path later. An open debug port, a weak update process, or an unknown dependency can affect the whole product. For CISOs, CTOs, and product security leaders, secure product development lifecycle requirements define what to protect, which controls to build, how to test for vulnerabilities, and who owns each security decision.
In practice, these requirements span six connected areas: security goals, threat modeling, hardware and firmware controls, component records, release checks, and postmarket response. Together, they answer two practical questions: what must the team do, and what evidence shows that the work is complete?
Identify assets, trust boundaries, and security goals.
Set controls for hardware, firmware, software, suppliers, and updates.
Test each control and record the result before release.
Prepare for reports, fixes, customer notices, and end of support.
Secure Product Development Lifecycle Requirements at a Glance
The table below puts the requirements first, then shows what each one tests, what the team should do next, and what evidence can support a release decision.
Secure Product Development Lifecycle Requirements and Evidence
Requirement
What it means
What it tests or controls
What to do now
Evidence and service fit
Security goals and asset inventory
Name key assets, users, data, interfaces, and trust boundaries.
Tests whether the design protects the right things.
Approve an asset and data-flow map.
Risk record and architecture review.
Threat model
Record attack paths, impact, controls, and owners.
Tests whether key abuse cases have a planned response.
Review threats after major design changes.
Threat model and assessment plan.
Hardware and firmware security
Protect debug ports, keys, boot paths, recovery, and updates.
Tests whether an attacker can bypass trust or persist.
Define secure boot, signing, key use, rollback, and factory controls.
Hardware, firmware, and reverse-engineering assessment.
Component and SBOM management
Track components, origin, version, and support status.
Tests whether the team can find exposure after a change.
Keep the SBOM current and define triage steps.
Component review and supply chain assessment.
Secure implementation
Build security into code, settings, interfaces, and build systems.
Tests for coding flaws, weak boundaries, and unsafe defaults.
Use peer review, analysis, fuzzing, and build controls.
Review findings and signed artifact records.
Security validation
Combine design, code, hardware, abuse-case, and penetration testing.
Tests whether controls work under attack.
Link each key requirement to a test, result, fix, and owner.
Release security record and risk decision.
Release and deployment integrity
Protect images, secrets, update channels, and recovery.
Tests whether tested files match shipped files.
Sign releases, protect secrets, and test offline recovery.
Hashes, signing logs, and release runbook.
Vulnerability response and support
Define intake, severity, fixes, notices, and end-of-support ownership.
Tests whether field risk can be handled after launch.
Assign owners and exercise the response path.
Response plan and postmarket records.
The matrix starts with the requirements because leaders need to see the control set before reviewing the process behind it. Its final column also points to the evidence and assessment work that makes those controls credible. The next step is to establish the assets, boundaries, and threats that determine which requirements matter most.
The table turns broad security goals into clear outcomes. Each outcome needs an owner, a test, and supporting evidence. NIST’s Secure Software Development Framework groups related work into four areas: prepare the organization, protect software, produce well-secured software, and respond to vulnerabilities. Teams can apply that model across hardware, firmware, cloud services, factories, and field support.
Start With Architecture and Threat Modeling
Security planning should begin before development with a map of key assets, trust boundaries, user roles, data flows, safety impacts, and external interfaces. Include both the product and the systems that support it.
For each major attack path, record the asset at risk, likely access, possible harm, required control, test method, and owner. This record turns a broad goal into a design task that teams can review and track.
A useful requirement is testable: “The boot chain checks approved firmware before it runs.” Add related rules for key approval, recovery, and verification failure so engineers and assessors can review the same target.
Threat modeling should also trigger a review when the product changes. A new radio, cloud endpoint, supplier, privilege, or update path can alter the attack surface, so do not wait for the next scheduled test. NIST describes SSDF as a basis for planning and ongoing improvement, not as a fixed checklist.
Architecture and Threat-Model Readiness
Architecture question
Ready signal
If the answer is “no”
What are the high-value assets?
Owners and impact are recorded.
The scope may miss a key asset.
Where are the trust boundaries?
Interfaces and data flows are mapped.
Attack paths may remain untested.
Which controls reduce each risk?
Each risk has a control and owner.
Work may start without a clear target.
How will each control be tested?
The test and pass result are defined.
Release evidence will be weak.Architecture question Ready signal If the answer is “no” What are the high-value assets? Owners and impact are recorded. The scope may miss a key asset. Where are the trust boundaries? Interfaces and data flows are mapped. Attack paths may remain untested. Which controls reduce each risk? Each risk has a control and owner. Work may start without a clear target. How will each control be tested? The test and pass result are defined. Release evidence will be weak.
The readiness check shows whether the security plan is specific enough to guide design work. Once assets, boundaries, and tests are named, the team can apply those requirements to the physical device, firmware, software, and supply chain.
Cover Hardware, Firmware, and Dependencies
Connected products cross physical, embedded, software, and operational layers. A weak bootloader can expose a product, but so can an exposed board port, device key, update server, or open-source package.
The requirement is not simply to “secure the device.” Define the control at each layer, then show how those layers work together.
Hardware requirements should cover trusted parts, debug access, key storage, physical access, fault handling, interfaces, and factory controls. Firmware requirements should address signed updates, key rotation, privilege limits, logs, recovery, and rollback. Software requirements should cover authentication, access rights, input handling, secrets, interfaces, and safe settings.
Dependency records need the same level of care. Track component origin, version, license, maintainer, support status, build system, and signing system. Define how the team will assess a new flaw, then set criteria for when to patch, mitigate, or retire a component.
IOActive treats component reviews as part of secure product development, with work that spans architecture and configuration review, static analysis, and dynamic analysis. Its full-stack assessment model extends from physical and semiconductor layers through software, process, governance, and supply chain security. That breadth helps when a risk crosses team or supplier lines.
Security Requirements by Product Layer
Layer
Requirement examples
Evidence to retain
Hardware
Restrict debug access, protect secrets, and define fault response.
Schematics, settings, lab findings, and fix status.
Firmware
Verify signed images, limit rights, and test recovery.
Boot logs, key design, update tests, and failure cases.
Software
Review entry points, dependencies, interfaces, and defaults.
Code review, analysis results, SBOM, and issue records.
Factory and supply chain
Control provisioning, build inputs, and signing access.
Supplier records, build records, access logs, and approvals.
The layer view makes ownership clearer. It also shows why a single application test cannot cover every product risk. With the control boundaries defined, the next section focuses on the evidence and assessment methods needed before release.
Validate Before Release
Use more than one assessment method because each one examines a different risk. Design review checks the security model, while code review and analysis examine the implementation. Fuzzing and abuse-case testing exercise unusual inputs and workflows, and penetration testing shows whether an attacker can combine flaws into a practical path. Start early so the team has time to fix what it finds.
IOActive recommends starting security testing during code development because early findings leave time to change an interface, replace a component, or revise a protocol. The same principle matters for hardware and firmware, where late changes can affect suppliers, tools, certification, and field updates.
Create a release security record that links each key requirement to its design, test result, known limit, fix status, and owner. Include the update system, factory process, physical attack surface, and residual-risk decision.
A release is not ready simply because a test took place. It is ready when the evidence shows that required controls work, every finding has an owner, and an accountable approver has accepted any remaining risk.
Deployment needs validation as well. Confirm that production images match tested images, sign release files, protect provisioning secrets, and set safe defaults. Test recovery for devices that are offline or hard to reach, and record who can approve an emergency release and how customers will receive it.
Pre-Release Validation Gates
Validation gate
Ready when
Not ready when
Design and threat model
Major risks have controls, owners, and tests.
High-impact risks remain assumptions.
Code and component review
Findings are fixed, accepted, or tracked.
Critical findings lack a decision or owner.
Hardware and firmware testing
Boot, update, recovery, and physical access are assessed.
Testing covers only the network or app layer.
Release integrity
The shipped file matches the approved, signed file.
Production steps cannot be checked.
Residual risk
A named approver accepts documented limits.
The team relies on a verbal decision.
These gates define readiness in operational terms. They connect technical findings to release ownership and make it harder for unresolved risk to disappear between testing and launch. The next requirement is a plan for issues that surface after the product reaches customers.
Plan for Vulnerabilities and Regulatory Duties
Before release, define a disclosure channel, intake process, severity model, patch flow, customer notice plan, and end-of-support policy. Assign owners across security, engineering, compliance, product, and operations so the response path is clear.
Exercise that path with failure cases, including devices that are offline, low on storage, or unable to reach the service.
The European Union Cyber Resilience Act places duties across the planning, design, development, and maintenance of covered products with digital elements. It also requires manufacturers to handle vulnerabilities throughout the product lifecycle. The European Commission’s manufacturer guidance highlights risk assessment, secure defaults, access control, cryptography, updates, technical records, support periods, and vulnerability handling.
The Act entered into force on December 10, 2024. Its reporting duties apply from September 11, 2026, while its main duties apply from December 11, 2027.
For medical-device makers, FDA cybersecurity guidance issued on February 3, 2026 addresses device design, labeling, and premarket records. It also covers Section 524B, including plans and procedures, processes for reasonable cybersecurity assurance, and software bills of materials for qualifying cyber devices. Because applicability depends on the product and market, compliance teams should map the rules to the device and submission path.
Postmarket Vulnerability and Support Readiness
Postmarket control
Readiness question
Evidence of readiness
If not ready
Vulnerability intake
Can researchers report issues and get an acknowledgement?
Public channel, triage owner, and intake record.
Reports may be lost or delayed.
Severity and remediation
Can the team rank issues and set response targets?
Severity model, decision log, and owners.
High-risk issues may wait too long.
Update delivery
Can the team build, test, sign, and ship a fix?
Exercised update path and release runbook.
A field flaw may stay open.
Customer communication
Can affected customers learn what to do?
Notice template and support workflow.
Customers may keep an unsafe setting.
Support period
Who owns security work through the end of support?
Named owner, dates, budget, and retirement plan.
Field risk may outlast the team.
The postmarket table turns support from a broad promise into a set of testable responsibilities. It also exposes gaps that can leave customers without a clear reporting, patch, or retirement path. Those responsibilities must then be assigned to owners and tied to review gates.
IOActive’s supply chain work treats resilience as both a technology and an operations issue. Its research record includes hardware, firmware, embedded, wireless, and software investigations. That range reinforces why product security evidence should follow the product across layers.
Turn Requirements Into Owned Release Gates
A secure product lifecycle becomes practical when each requirement is specific, owned, testable, and tied to a decision. Start with the main table, then convert each row into a requirement statement with an owner, acceptance test, evidence location, and review trigger.
“Protect firmware updates” is too broad to approve. A stronger set of rules names image signing, key custody, failed verification, rollback, recovery access, and the test for each control. The same pattern works for threat models, SBOMs, factory provisioning, response, and support.
Use a simple review cycle that revisits the requirements at architecture review, major design change, code-complete review, release review, and postmarket incident review. This keeps decisions visible as the product, supplier, or threat changes.
Ownership and Review Gates
Requirement record
Owner
Acceptance evidence
Review trigger
Security goal
Product security lead
Approved risk and asset scope
New product or major use change
Technical control
Engineering owner
Design record and test result
Architecture or code change
Component record
Software or supply chain owner
Current SBOM and triage decision
New dependency or supplier change
Release gate
Release owner
Signed artifact and risk approval
Release candidate or emergency fix
Support commitment
Product and operations owners
Update, disclosure, and end-of-support plan
Launch, incident, or support change
This ownership model closes the loop between a written requirement and the decision to ship or continue support. It gives product, engineering, security, and operations a shared review structure, which sets up the final release check below.
IOActive combines research with hands-on expertise across hardware, embedded systems, software, and full-stack assessments. That combination can help teams assess gaps, test controls, and build evidence that supports product, risk, and compliance decisions.
Make Security a Product Requirement
Use the final check below to confirm that the release decision has a clear basis.
Final Secure Release Check
Final check
Readiness signal
Every requirement has an owner.
Accountability is clear.
Every key control has a test and evidence record.
The release decision is supportable.
Postmarket owners and dates are set.
Field risk has a clear path.
The final check confirms that the process is ready beyond the technical test itself. If any answer is no, the release decision needs a named owner, a documented action, or an explicit risk acceptance before launch.
Secure product development lifecycle requirements are more than a final testing checklist. They define the controls for design, build, validation, deployment, and support.
When every requirement has an owner, test, evidence record, and review trigger, security becomes part of how the product is built and maintained. That structure gives teams a clear basis for release and support decisions.
IOActive recently attended the 2026 OCP APAC Summit in Taipei. Below are our key takeaways from two days with the Open Compute community, along with a short recap video from the show floor at the end of this post.
Key Takeaways
The 2026 OCP APAC Summit (August 11–12) drew hyperscalers, semiconductor companies, device manufacturers, and infrastructure providers under the theme “Leading the Future of AI.”
AI security conversations extended beyond compute performance to the full stack: networking, cooling, storage, power, firmware, and the security controls underneath all of it.
Openness was a recurring theme, anchored by a dedicated SONiC Workshop on the open-source network operating system.
Multiple talks and vendor conversations pointed to growing interest in OCP S.A.F.E., the framework for independent security review of device firmware.
IOActive helped develop OCP S.A.F.E. from its early stages and continues to evaluate firmware security for device manufacturers today.
AI in the Agentic Era
AI was naturally at the center of this year’s summit, but the conversation went well past GPUs and raw compute performance.
The future of AI depends as much on trustworthy infrastructure as it does on faster accelerators and larger clusters. That means thinking about security across the whole stack, from applications and operating systems down to the firmware and hardware controlling the physical devices.
Open Data Centers and Open Networking
Openness was the other constant. The Open Compute Project’s philosophy of open hardware specifications, interoperable architectures, open firmware increasingly extends to networking, and the summit’s dedicated SONiC Workshop was a good example. SONiC, the open-source network operating system, brought together developers, users, maintainers, and vendors to compare notes on real-world deployments.
The direction of travel is toward data centers built from a diverse ecosystem of components rather than a single vertically integrated platform. That shift raises a practical question for operators: as devices and firmware arrive from a wider set of suppliers, how do you know they were built securely?
OCP S.A.F.E. and the Case for Independent Security Review
That question was the throughline of many of our conversations at the summit. Multiple technical talks and device-vendor discussions pointed to growing interest in OCP S.A.F.E., which lets vendors have their products evaluated by independent security reviewers against an established methodology.
For manufacturers, that’s more than a compliance checkbox. An independent review can surface vulnerabilities in firmware and other security-critical components before devices ship at scale, and it gives customers a concrete basis for confidence in what they’re deploying. As the supply chain behind any given rack grows more diverse, security assurance needs to travel with it.
IOActive has been involved in developing the OCP S.A.F.E. framework since its early stages, and we continue to work with device manufacturers on firmware and security assessments across the infrastructure being deployed today.
Taipei as a Meeting Point
Taipei was a fitting location for these conversations. Taiwan sits at the center of the global technology supply chain, home to a dense concentration of semiconductor companies, server manufacturers, ODMs, component suppliers, and firmware developers—much of the ecosystem responsible for the infrastructure data centers worldwide run on.
The summit itself made room for those conversations to happen: networking lounges, meeting areas, and coffee stations throughout the venue, lunch on-site, and reception drinks in the Expo Hall on the first evening. Live translation kept the technical sessions accessible to an international audience.
If you’re a device vendor preparing for OCP S.A.F.E. or looking to strengthen your firmware’s security, contact IOActive. Our team supports OCP S.A.F.E. assessments and independent firmware source-code security reviews.
Watch Our OCP APAC Summit Recap
Want to see the event from the show floor? We captured some of the technologies, conversations, and demonstrations from our time at the 2026 OCP APAC Summit in Taipei.