File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -298,7 +298,7 @@ pub enum SystemInstruction {
298298 } ,
299299}
300300
301- /// Create an account.
301+ /// Create an account, failing if the account previously had any balance .
302302///
303303/// This function produces an [`Instruction`] which must be submitted in a
304304/// [`Transaction`] or [invoked] to take effect, containing a serialized
@@ -312,6 +312,13 @@ pub enum SystemInstruction {
312312/// [`transfer`] lamports for rent, [`assign`] to its owning program. The
313313/// [`create_account`] function does all three at once.
314314///
315+ /// # Security issues
316+ ///
317+ /// Using this function is a security issue if the `to_address` is predictable
318+ /// by an attacker. The attacker can prefund the address with lamports and
319+ /// thereby prevent the successful execution of the `create_account` call. This
320+ /// can DoS an on-chain program.
321+ ///
315322/// # Required signers
316323///
317324/// The `from_address` and `to_address` signers must sign the transaction.
You can’t perform that action at this time.
0 commit comments