Giter VIP home page Giter VIP logo

ustc-hackergame / hackergame2023-writeups Goto Github PK

View Code? Open in Web Editor NEW
168.0 2.0 61.0 235.59 MB

Hackergame 2023 的官方与非官方题解

License: Other

Dockerfile 0.09% Shell 0.07% Python 2.89% CSS 0.10% HTML 1.01% Makefile 0.01% Lex 0.01% C 2.64% Yacc 0.03% Go 0.04% Sage 0.27% Rust 0.47% CMake 0.04% C++ 0.16% Jupyter Notebook 2.01% JavaScript 89.42% Vue 0.38% SCSS 0.15% TypeScript 0.01% Solidity 0.19%

hackergame2023-writeups's Issues

JSON ⊂ YAML 题解中,“用一个输入同时获得两个 flag“ 有误

原文中

至于如何能用一个输入同时获得两个 flag,出题人认为最短的答案需要 13 个字符:{"":1e2,"":0}。

然而在网页终端中输入此答案,只能获取flag2,没有flag1。

Input your JSON: {"":1e2,"":0}
As JSON: {'': 0}
As YAML 1.1: {'': 0}
No flag1
Flag2: flag{.............}

RFC 8259

RFC 8259 的表述更严格一些,它说:

The names within an object SHOULD be unique.
其中大写的“SHOULD”是 RFC 的一个术语,表示特定情况下可以违反这个规则,但是要考虑到可能会导致的问题。

然而,YAML 1.2 说:

The content of a mapping node is an unordered set of key/value node pairs, with the restriction that each of the keys is unique.
这个规则是绝对的,YAML 1.2 解析器在遇到重复的键时必须报错。

但是注意到RFC 8259是这么说的

When the names within an object are not unique, the behavior of software that receives such an object is unpredictable. Many implementations report the last name/value pair only. Other implementations report an error or fail to parse the object, and some implementations report all of the name/value pairs, including duplicates.

也就是说YAML 1.2选择直接报错也是一种合法的unpredictable的JSON实现,未违反RFC 8259解析JSON的要求。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.