CVE-2023-50428 Overview
CVE-2023-50428 is a data handling vulnerability affecting Bitcoin Core through version 26.0 and Bitcoin Knots before version 25.1.knots20231115. The vulnerability allows attackers to bypass datacarrier size limits by obfuscating data as code, specifically by using OP_FALSE OP_IF opcodes. This technique has been actively exploited in the wild by Inscriptions since 2022 and 2023.
The vulnerability enables arbitrary data to be embedded in the Bitcoin blockchain beyond intended limits, which can lead to blockchain bloat and increased resource consumption for node operators. It's worth noting that while the Bitcoin Knots project considers this a security vulnerability, some in the Bitcoin community consider it "not a bug" and view Inscriptions as a legitimate use of the protocol.
Critical Impact
Datacarrier size limits can be bypassed allowing arbitrary data embedding in the Bitcoin blockchain, potentially causing increased storage requirements and network resource consumption for all node operators.
Affected Products
- Bitcoin Core through version 26.0
- Bitcoin Knots before version 25.1.knots20231115
Discovery Timeline
- 2023-12-09 - CVE-2023-50428 published to NVD
- 2024-11-21 - Last updated in NVD database
Technical Details for CVE-2023-50428
Vulnerability Analysis
This vulnerability represents a policy bypass that circumvents the datacarrier size limits implemented in Bitcoin Core and Bitcoin Knots. The datacarrier mechanism was designed to limit the amount of arbitrary data that could be embedded in Bitcoin transactions through OP_RETURN outputs. However, the exploit leverages Bitcoin Script's conditional execution capabilities to embed data in ways that bypass these restrictions.
The attack has been observed in production through the Inscriptions protocol, which embeds images, text, and other arbitrary data directly into Bitcoin transactions. This represents an improper input validation issue where the node software fails to properly account for data obfuscated as executable code within script conditionals.
Root Cause
The root cause lies in how Bitcoin Core and Bitcoin Knots enforce datacarrier limits. The enforcement logic inspects OP_RETURN outputs to limit embedded data, but it does not account for data hidden within conditional script structures. By wrapping data payload within OP_FALSE OP_IF ... OP_ENDIF constructs, the data appears as unreachable code rather than a datacarrier, effectively circumventing the size restrictions defined in the mempool options.
Attack Vector
The attack is network-accessible and requires no authentication or user interaction. Attackers construct specially crafted transactions that:
- Place arbitrary data between OP_FALSE OP_IF and OP_ENDIF opcodes
- The conditional block never executes (due to OP_FALSE), but the data persists in the blockchain
- This data is not counted against datacarrier limits because it appears as unreachable code
- Transactions are propagated through the network and mined into blocks
The exploitation mechanism relies on the following Bitcoin Script pattern: a transaction witness or scriptSig begins with OP_FALSE, followed by OP_IF, then contains arbitrary data bytes as fake opcodes, and concludes with OP_ENDIF. Since the OP_FALSE ensures the conditional is never executed, the embedded data never affects transaction validation but permanently resides on the blockchain.
Detection Methods for CVE-2023-50428
Indicators of Compromise
- Transactions containing OP_FALSE OP_IF patterns with large data payloads between conditional markers
- Unusual increase in transaction witness sizes without corresponding script complexity
- Presence of Inscription-style transactions in the mempool or recent blocks
- Elevated storage growth rate on Bitcoin nodes beyond expected transaction throughput
Detection Strategies
- Monitor mempool for transactions with anomalous witness data sizes
- Implement custom transaction filtering rules to detect OP_FALSE OP_IF patterns with embedded data
- Review node logs for unusual transaction sizes that don't match standard payment patterns
- Deploy network monitoring to identify transaction propagation patterns associated with Inscription services
Monitoring Recommendations
- Track blockchain growth rates and compare against historical baselines
- Monitor disk usage on Bitcoin nodes for unexpected increases
- Set up alerts for transactions exceeding typical witness sizes
- Consider implementing mempool policies that reject transactions matching known Inscription patterns
How to Mitigate CVE-2023-50428
Immediate Actions Required
- Upgrade Bitcoin Knots to version 25.1.knots20231115 or later which includes fixes for this issue
- Review the Bitcoin Knots release notes for specific patch details
- Consider implementing local mempool policies to filter transactions exploiting this bypass
- Monitor disk space and bandwidth usage on Bitcoin nodes for unexpected increases
Patch Information
Bitcoin Knots has addressed this vulnerability in version 25.1.knots20231115. The patch implements additional checks to detect data obfuscated within conditional script constructs and applies datacarrier limits more comprehensively.
For Bitcoin Core, as of version 26.0, no official patch has been released as some maintainers do not consider this behavior a vulnerability. Node operators concerned about this issue may consider switching to Bitcoin Knots or implementing custom mempool policies.
Additional discussion and context can be found in the Bitcoin GitHub pull request comments and Luke Dashjr's update on Twitter.
Workarounds
- Configure custom mempool acceptance policies using -datacarriersize=0 to reject all transactions with OP_RETURN outputs (note: this does not fully address the OP_FALSE OP_IF bypass)
- Implement transaction relay filtering at the network level to reject known Inscription patterns
- Increase node storage capacity to accommodate potential blockchain bloat
- Consider running Bitcoin Knots instead of Bitcoin Core if stricter data embedding policies are desired
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


