<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Log4j2 - Category - p0l1st&#39;s blog</title>
    <link>https://blog.p0l1st.top/categories/log4j2/</link>
    <description>p0l1st&#39;s blog</description>
    <generator>Hugo 0.161.1 &amp; FixIt v0.4.5</generator>
    <language>en-us</language>
    <managingEditor>p0l1st@venomsec.org (p0l1st)</managingEditor>
    <webMaster>p0l1st@venomsec.org (p0l1st)</webMaster>
    <lastBuildDate>Tue, 01 Sep 2026 15:08:05 +0800</lastBuildDate>
    <atom:link href="https://blog.p0l1st.top/categories/log4j2/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Log4j2 MarshalledObject二次反序列化</title>
      <link>https://blog.p0l1st.top/post/log4j2-marshalledobject%E4%BA%8C%E6%AC%A1%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96/</link>
      <pubDate>Tue, 01 Sep 2026 15:08:05 +0800</pubDate><author>p0l1st@venomsec.org (p0l1st)</author>
      <guid>https://blog.p0l1st.top/post/log4j2-marshalledobject%E4%BA%8C%E6%AC%A1%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96/</guid>
      <category domain="https://blog.p0l1st.top/categories/log4j2/">Log4j2</category>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://mp.weixin.qq.com/s/SISyQLvg17GabC0YB7Pfvw&#34; target=&#34;_blank&#34; rel=&#34;external nofollow noopener noreferrer&#34;&gt;https://mp.weixin.qq.com/s/SISyQLvg17GabC0YB7Pfvw&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;code&gt;MarshalledObject&lt;/code&gt;的&lt;code&gt;get&lt;/code&gt;方法可以反序列化&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;public T get() throws IOException, ClassNotFoundException {&#xA;    if (objBytes == null)   // must have been a null object&#xA;        return null;&#xA;&#xA;    ByteArrayInputStream bin = new ByteArrayInputStream(objBytes);&#xA;    // locBytes is null if no annotations&#xA;    ByteArrayInputStream lin =&#xA;        (locBytes == null ? null : new ByteArrayInputStream(locBytes));&#xA;    MarshalledObjectInputStream in =&#xA;        new MarshalledObjectInputStream(bin, lin);&#xA;    @SuppressWarnings(&amp;#34;unchecked&amp;#34;)&#xA;    T obj = (T) in.readObject();&#xA;    in.close();&#xA;    return obj;&#xA;}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;objBytes&lt;/code&gt;可控&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt; private byte[] objBytes = null;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;可通过构造方法赋值&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
