<PAGE>

                                                                   Exhibit 10.22

                              SECURITY AGREEMENT

     This Security Agreement is made as of April 3, 1998 between Lexar Media,
Inc., a California corporation ("Pledgee"), and Petro Estakhri ("Pledgor").

                                   Recitals
                                   --------

     WHEREAS, pursuant to a Secured Full Recourse Promissory Note of even date
herewith, Pledgor has borrowed $40,000 from Pledgee and Pledgor wishes to secure
such loan by granting a security interest in certain shares of the Pledgee's
Common Stock, on and subject to the terms and conditions contained in this
Security Agreement;

     NOW, THEREFORE, it is agreed as follows:

     1.   Creation and Description of Security Interest.  In consideration of
          ---------------------------------------------
the Loan, Pledgor, pursuant to the Commercial Code of the State of California,
hereby pledges all of the shares of Common Stock (herein sometimes referred to
as the "Shares" or "Collateral") represented by 50,000 shares duly endorsed in
blank or with executed stock powers, and herewith delivers said shares to the
Secretary of Pledgee ("Pledgeholder").  Who shall hold said certificate as
bailee for Pledgor subject to the terms and conditions of this Security
Agreement.

     The pledged stock (together with an executed blank stock assignment), shall
be held by the Pledgeholder as bailee for Pledgor as security for the repayment
of the Note, and any extensions or renewals thereof, to be executed by Pledgor
pursuant to the terms of the Purchase Agreements, and the Pledgeholder shall not
encumber or dispose of such Shares except in the accordance with the provisions
of this Security Agreement.

     2.   Pledgor's Representations and Covenants.  To include Pledgee to make
          ---------------------------------------
the Loan and enter into this Security Agreement, Pledgor represents and
covenants to Pledgee, its successors and assigns, as follows:

          (a)  Payment of Indebtedness.  Pledgor will pay the principal sum of
               -----------------------
the Note secured hereby, together with interest thereon, at the time and in the
manner provided in the Note.

          (b)  Encumbrances.  The Shares are free of all other encumbrances,
               ------------
defenses and liens, and Pledgor will not further encumber the Shares without the
prior written consent of Pledgee.

          (c)  Margin Regulations.  In the event that Pledgee's Common Stock
               ------------------
becomes margin-listed by the Federal Reserve Board subsequent to the execution
of this Security Agreement, and Pledgee is classified as a "lender" within the
meaning of the regulations under Part 207 of Title 12 of the Code of Federal
Regulations ("Regulation G"), Pledgor agrees to operate with Pledgee in making
any amendments to the Note or providing any additional collateral as may be
necessary to comply with such regulations.
<PAGE>

     3.   Voting Rights.  During the term of this pledge and so long as all
          -------------
payments of principal and interest are made as they become due under the terms
of the Note, Pledgor shall have the right to vote all of the Shares pledged
hereunder.

     4.   Stock Adjustments.  In the event that during the term of the pledge
          -----------------
any stock dividend, reclassification, readjustment or other changes declared or
made in the capital structure of Pledgee, all new, substituted and additional
shares or other securities issued by reason of any such change shall be
delivered to and held by the Pledgee under the terms of this Security Agreement
in the same manner as the Shares originally pledged hereunder.  In the event of
substitution of such securities, Pledgor, Pledgee and Pledgeholder shall
cooperate and execute such documents as are reasonable so as to provide for the
substitution of such Collateral and, upon such substitution, references to
"Shares" in this Security Agreement shall include the substituted shares of
capital stock of Pledgor as a result thereof.

     5.   Warrants and Rights.  In the event that, during the term of this
          -------------------
pledge, subscription warrants or other rights or options shall be issued in
connection with the pledged Shares, such rights, warrants and options shall be
the property of Pledgor and, if exercised by Pledgor, all new stock or other
securities so acquired by Pledgor as it relates to the pledged Shares then held
by Pledgeholder shall be immediately delivered to Pledgeholder, to be held under
the terms of this Security Agreement in the same manner as the Shares pledged.

     6.   Default.  Pledgor shall be deemed to be in default of the Note and of
          -------
this Security Agreement in the event:

          (a)  Payment of principal or interest on the Note shall be delinquent
for a period of 10 days or more; or

          (b)  Pledgor fails to perform any of the covenants set forth in either
of the Purchase Agreements or contained in this Security Agreement for a period
of 10 days after written notice thereof from Pledgee.

     In the case of an event of Default, set forth above, Pledgee shall have the
right to accelerate payment of the Note upon notice to Pledgor, and Pledgee
shall thereafter be entitled to pursue his remedies under the California
Commercial Code.

     7.   Release of Collateral.  Subject to any applicable contrary rules under
          ---------------------
Regulation G, there shall be released from this pledge a portion of the pledged
Shares held by Pledgeholder hereunder upon payments of the principal of the
Note.  The number of the pledged Shares which shall be released shall be that
number of full Shares which bears the same proportion to the initial number of
Shares pledged hereunder as the payment of principal bears to the initial full
principal amount of the Note.

     8.   Withdrawal of Substitution of Collateral.  Pledgor shall not sell,
          ----------------------------------------
withdraw, pledge, substitute or otherwise dispose of all or any part of the
Collateral without the prior written consent of Pledgee.

                                       2
<PAGE>

     9.   Term.  The within pledge of Shares shall continue the payment of all
          ----
indebtedness secured hereby, at which time the remaining pledged stock shall be
promptly delivered to Pledgor, subject to the provisions for prior release of a
portion of the Collateral as provided in paragraph 7 above.

     10.  Insolvency.  Pledgor agrees that if a bankruptcy or insolvency
          ----------
proceeding is instituted by or against it, or if a receiver is appointed for the
property of Pledgor, or if Pledgor makes an assignment for the benefit of
creditors, the entire amount unpaid on the Note shall be come immediately due
and payable, and Pledgee may proceed as provided in the case of default.

     11.  Pledgeholder Liability.  In the absence of willful or gross
          ----------------------
negligence, Pledgeholder shall not be liable to any party for any of his acts,
or omissions to act, as Pledgeholder.

     12.  Invalidity of Particular Provisions.  Pledgor and Pledgee agree that
          -----------------------------------
the enforceability or invalidity of any provision or provisions of this Security
Agreement shall not render any other provision or provisions herein contained
unenforceable or invalid.

     13.  Successors or Assigns.  Pledgor and Pledgee agree that all of the
          ---------------------
terms of this Security Agreement shall be binding on their respective successors
and assigns, and that the term "Pledgor" and the term "Pledgee" as used herein
shall be deemed to include, for all purposes, the respective designees,
successors, assigns, heirs, executors and administrators.

     14.  Governing Law.  This Security Agreement shall be interpreted and
          -------------
governed under the laws of the State of California.

                                       3
<PAGE>

     IN WITNESS WHEREOF, the parties hereto have executed this Agreement as of
the day and year first above written.


"PLEDGOR"                                            /s/
                                                     ----------------------

                                                     ----------------------

"PLEDGEE"                                            Lexar Media, Inc.
                                                     a California corporation

                                                     By:___________________
                                                     Title:________________

"PLEDGEHOLDER"                                       ______________________
                                                     ______________________
                                                     Secretary of _________


                                       4